Barotrauma Client Doc
Barotrauma.CargoManager Class Reference

Public Member Functions

 CargoManager (CampaignMode campaign)
 
List< PurchasedItemGetBuyCrateItems (Identifier identifier, bool create=false)
 
List< PurchasedItemGetBuyCrateItems (Location.StoreInfo store, bool create=false)
 
PurchasedItem GetBuyCrateItem (Identifier identifier, ItemPrefab prefab)
 
PurchasedItem GetBuyCrateItem (Location.StoreInfo store, ItemPrefab prefab)
 
List< PurchasedItemGetSellCrateItems (Identifier identifier, bool create=false)
 
List< PurchasedItemGetSellCrateItems (Location.StoreInfo store, bool create=false)
 
PurchasedItem GetSellCrateItem (Identifier identifier, ItemPrefab prefab)
 
PurchasedItem GetSellCrateItem (Location.StoreInfo store, ItemPrefab prefab)
 
List< PurchasedItemGetSubCrateItems (Identifier identifier, bool create=false)
 
List< PurchasedItemGetSubCrateItems (Location.StoreInfo store, bool create=false)
 
PurchasedItem GetSubCrateItem (Identifier identifier, ItemPrefab prefab)
 
PurchasedItem GetSubCrateItem (Location.StoreInfo store, ItemPrefab prefab)
 
List< PurchasedItemGetPurchasedItems (Identifier identifier, bool create=false)
 
List< PurchasedItemGetPurchasedItems (Location.StoreInfo store, bool create=false)
 
int GetPurchasedItemCount (Location.StoreInfo store, ItemPrefab prefab)
 
int GetPurchasedItemCount (Identifier identifier, ItemPrefab prefab)
 
List< SoldItemGetSoldItems (Identifier identifier, bool create=false)
 
List< SoldItemGetSoldItems (Location.StoreInfo store, bool create=false)
 
void ClearItemsInBuyCrate ()
 
void ClearItemsInSellCrate ()
 
void ClearItemsInSellFromSubCrate ()
 
void SetPurchasedItems (Dictionary< Identifier, List< PurchasedItem >> purchasedItems)
 
void ModifyItemQuantityInBuyCrate (Identifier storeIdentifier, ItemPrefab itemPrefab, int changeInQuantity, Client client=null)
 
void ModifyItemQuantityInSubSellCrate (Identifier storeIdentifier, ItemPrefab itemPrefab, int changeInQuantity, Client client=null)
 
void PurchaseItems (Identifier storeIdentifier, List< PurchasedItem > itemsToPurchase, bool removeFromCrate, Client client=null)
 
Dictionary< ItemPrefab, int > GetBuyValuesAtCurrentLocation (Identifier storeIdentifier, IEnumerable< ItemPrefab > items)
 
Dictionary< ItemPrefab, int > GetSellValuesAtCurrentLocation (Identifier storeIdentifier, IEnumerable< ItemPrefab > items)
 
void CreatePurchasedItems ()
 
IEnumerable< ItemGetSellableItemsFromSub ()
 
void InitPurchasedIDCards ()
 
void SavePurchasedItems (XElement parentElement)
 
void LoadPurchasedItems (XElement element)
 
IEnumerable< ItemGetSellableItems (Character character)
 
void SetItemsInBuyCrate (Dictionary< Identifier, List< PurchasedItem >> items)
 
void SetItemsInSubSellCrate (Dictionary< Identifier, List< PurchasedItem >> items)
 
void SetSoldItems (Dictionary< Identifier, List< SoldItem >> items)
 
void ModifyItemQuantityInSellCrate (Identifier storeIdentifier, ItemPrefab itemPrefab, int changeInQuantity)
 
void SellItems (Identifier storeIdentifier, List< PurchasedItem > itemsToSell, Store.StoreTab sellingMode)
 
void ClearSoldItemsProjSpecific ()
 

Static Public Member Functions

static bool HasUnlockedStoreItem (ItemPrefab prefab)
 
static IReadOnlyCollection< ItemFindAllItemsOnPlayerAndSub (Character character)
 
static IEnumerable< ItemFindAllSellableItems ()
 
static IEnumerable< HullFindCargoRooms (IEnumerable< Submarine > subs)
 
static IEnumerable< HullFindCargoRooms (Submarine sub)
 
static IEnumerable< ItemFilterCargoCrates (IEnumerable< Item > items, Func< Item, bool > conditional=null)
 
static IEnumerable< ItemContainerFindReusableCargoContainers (IEnumerable< Submarine > subs, IEnumerable< Hull > cargoRooms=null)
 
static ItemContainer GetOrCreateCargoContainerFor (ItemPrefab item, ISpatialEntity cargoRoomOrSpawnPoint, ref List< ItemContainer > availableContainers)
 
static void DeliverItemsToSub (IEnumerable< PurchasedItem > itemsToSpawn, Submarine sub, CargoManager cargoManager)
 
static void DeliverItemsToCharacter (IEnumerable< PurchasedItem > itemsToSpawn, Character character, CargoManager cargoManager)
 
static Vector2 GetCargoPos (Hull hull, ItemPrefab itemPrefab)
 

Public Attributes

readonly NamedEvent< CargoManagerOnItemsInBuyCrateChanged = new NamedEvent<CargoManager>()
 
readonly NamedEvent< CargoManagerOnItemsInSellCrateChanged = new NamedEvent<CargoManager>()
 
readonly NamedEvent< CargoManagerOnItemsInSellFromSubCrateChanged = new NamedEvent<CargoManager>()
 
readonly NamedEvent< CargoManagerOnPurchasedItemsChanged = new NamedEvent<CargoManager>()
 
readonly NamedEvent< CargoManagerOnSoldItemsChanged = new NamedEvent<CargoManager>()
 

Static Public Attributes

const int MaxQuantity = 100
 

Properties

Dictionary< Identifier, List< PurchasedItem > > ItemsInBuyCrate = new Dictionary<Identifier, List<PurchasedItem>>() [get]
 
Dictionary< Identifier, List< PurchasedItem > > ItemsInSellCrate = new Dictionary<Identifier, List<PurchasedItem>>() [get]
 
Dictionary< Identifier, List< PurchasedItem > > ItemsInSellFromSubCrate = new Dictionary<Identifier, List<PurchasedItem>>() [get]
 
Dictionary< Identifier, List< PurchasedItem > > PurchasedItems = new Dictionary<Identifier, List<PurchasedItem>>() [get]
 
Dictionary< Identifier, List< SoldItem > > SoldItems = new Dictionary<Identifier, List<SoldItem>>() [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ CargoManager()

Barotrauma.CargoManager.CargoManager ( CampaignMode  campaign)

Member Function Documentation

◆ ClearItemsInBuyCrate()

void Barotrauma.CargoManager.ClearItemsInBuyCrate ( )

◆ ClearItemsInSellCrate()

void Barotrauma.CargoManager.ClearItemsInSellCrate ( )

◆ ClearItemsInSellFromSubCrate()

void Barotrauma.CargoManager.ClearItemsInSellFromSubCrate ( )

◆ ClearSoldItemsProjSpecific()

void Barotrauma.CargoManager.ClearSoldItemsProjSpecific ( )

◆ CreatePurchasedItems()

void Barotrauma.CargoManager.CreatePurchasedItems ( )

◆ DeliverItemsToCharacter()

static void Barotrauma.CargoManager.DeliverItemsToCharacter ( IEnumerable< PurchasedItem itemsToSpawn,
Character  character,
CargoManager  cargoManager 
)
static

◆ DeliverItemsToSub()

static void Barotrauma.CargoManager.DeliverItemsToSub ( IEnumerable< PurchasedItem itemsToSpawn,
Submarine  sub,
CargoManager  cargoManager 
)
static

◆ FilterCargoCrates()

static IEnumerable<Item> Barotrauma.CargoManager.FilterCargoCrates ( IEnumerable< Item items,
Func< Item, bool >  conditional = null 
)
static

◆ FindAllItemsOnPlayerAndSub()

static IReadOnlyCollection<Item> Barotrauma.CargoManager.FindAllItemsOnPlayerAndSub ( Character  character)
static

◆ FindAllSellableItems()

static IEnumerable<Item> Barotrauma.CargoManager.FindAllSellableItems ( )
static

◆ FindCargoRooms() [1/2]

static IEnumerable<Hull> Barotrauma.CargoManager.FindCargoRooms ( IEnumerable< Submarine subs)
static

◆ FindCargoRooms() [2/2]

static IEnumerable<Hull> Barotrauma.CargoManager.FindCargoRooms ( Submarine  sub)
static

◆ FindReusableCargoContainers()

static IEnumerable<ItemContainer> Barotrauma.CargoManager.FindReusableCargoContainers ( IEnumerable< Submarine subs,
IEnumerable< Hull cargoRooms = null 
)
static

◆ GetBuyCrateItem() [1/2]

PurchasedItem Barotrauma.CargoManager.GetBuyCrateItem ( Identifier  identifier,
ItemPrefab  prefab 
)

◆ GetBuyCrateItem() [2/2]

PurchasedItem Barotrauma.CargoManager.GetBuyCrateItem ( Location.StoreInfo  store,
ItemPrefab  prefab 
)

◆ GetBuyCrateItems() [1/2]

List<PurchasedItem> Barotrauma.CargoManager.GetBuyCrateItems ( Identifier  identifier,
bool  create = false 
)

◆ GetBuyCrateItems() [2/2]

List<PurchasedItem> Barotrauma.CargoManager.GetBuyCrateItems ( Location.StoreInfo  store,
bool  create = false 
)

◆ GetBuyValuesAtCurrentLocation()

Dictionary<ItemPrefab, int> Barotrauma.CargoManager.GetBuyValuesAtCurrentLocation ( Identifier  storeIdentifier,
IEnumerable< ItemPrefab items 
)

◆ GetCargoPos()

static Vector2 Barotrauma.CargoManager.GetCargoPos ( Hull  hull,
ItemPrefab  itemPrefab 
)
static

◆ GetOrCreateCargoContainerFor()

static ItemContainer Barotrauma.CargoManager.GetOrCreateCargoContainerFor ( ItemPrefab  item,
ISpatialEntity  cargoRoomOrSpawnPoint,
ref List< ItemContainer availableContainers 
)
static

◆ GetPurchasedItemCount() [1/2]

int Barotrauma.CargoManager.GetPurchasedItemCount ( Identifier  identifier,
ItemPrefab  prefab 
)

◆ GetPurchasedItemCount() [2/2]

int Barotrauma.CargoManager.GetPurchasedItemCount ( Location.StoreInfo  store,
ItemPrefab  prefab 
)

◆ GetPurchasedItems() [1/2]

List<PurchasedItem> Barotrauma.CargoManager.GetPurchasedItems ( Identifier  identifier,
bool  create = false 
)

◆ GetPurchasedItems() [2/2]

List<PurchasedItem> Barotrauma.CargoManager.GetPurchasedItems ( Location.StoreInfo  store,
bool  create = false 
)

◆ GetSellableItems()

IEnumerable<Item> Barotrauma.CargoManager.GetSellableItems ( Character  character)

◆ GetSellableItemsFromSub()

IEnumerable<Item> Barotrauma.CargoManager.GetSellableItemsFromSub ( )

◆ GetSellCrateItem() [1/2]

PurchasedItem Barotrauma.CargoManager.GetSellCrateItem ( Identifier  identifier,
ItemPrefab  prefab 
)

◆ GetSellCrateItem() [2/2]

PurchasedItem Barotrauma.CargoManager.GetSellCrateItem ( Location.StoreInfo  store,
ItemPrefab  prefab 
)

◆ GetSellCrateItems() [1/2]

List<PurchasedItem> Barotrauma.CargoManager.GetSellCrateItems ( Identifier  identifier,
bool  create = false 
)

◆ GetSellCrateItems() [2/2]

List<PurchasedItem> Barotrauma.CargoManager.GetSellCrateItems ( Location.StoreInfo  store,
bool  create = false 
)

◆ GetSellValuesAtCurrentLocation()

Dictionary<ItemPrefab, int> Barotrauma.CargoManager.GetSellValuesAtCurrentLocation ( Identifier  storeIdentifier,
IEnumerable< ItemPrefab items 
)

◆ GetSoldItems() [1/2]

List<SoldItem> Barotrauma.CargoManager.GetSoldItems ( Identifier  identifier,
bool  create = false 
)

◆ GetSoldItems() [2/2]

List<SoldItem> Barotrauma.CargoManager.GetSoldItems ( Location.StoreInfo  store,
bool  create = false 
)

◆ GetSubCrateItem() [1/2]

PurchasedItem Barotrauma.CargoManager.GetSubCrateItem ( Identifier  identifier,
ItemPrefab  prefab 
)

◆ GetSubCrateItem() [2/2]

PurchasedItem Barotrauma.CargoManager.GetSubCrateItem ( Location.StoreInfo  store,
ItemPrefab  prefab 
)

◆ GetSubCrateItems() [1/2]

List<PurchasedItem> Barotrauma.CargoManager.GetSubCrateItems ( Identifier  identifier,
bool  create = false 
)

◆ GetSubCrateItems() [2/2]

List<PurchasedItem> Barotrauma.CargoManager.GetSubCrateItems ( Location.StoreInfo  store,
bool  create = false 
)

◆ HasUnlockedStoreItem()

static bool Barotrauma.CargoManager.HasUnlockedStoreItem ( ItemPrefab  prefab)
static

◆ InitPurchasedIDCards()

void Barotrauma.CargoManager.InitPurchasedIDCards ( )

◆ LoadPurchasedItems()

void Barotrauma.CargoManager.LoadPurchasedItems ( XElement  element)

◆ ModifyItemQuantityInBuyCrate()

void Barotrauma.CargoManager.ModifyItemQuantityInBuyCrate ( Identifier  storeIdentifier,
ItemPrefab  itemPrefab,
int  changeInQuantity,
Client  client = null 
)

◆ ModifyItemQuantityInSellCrate()

void Barotrauma.CargoManager.ModifyItemQuantityInSellCrate ( Identifier  storeIdentifier,
ItemPrefab  itemPrefab,
int  changeInQuantity 
)

◆ ModifyItemQuantityInSubSellCrate()

void Barotrauma.CargoManager.ModifyItemQuantityInSubSellCrate ( Identifier  storeIdentifier,
ItemPrefab  itemPrefab,
int  changeInQuantity,
Client  client = null 
)

◆ PurchaseItems()

void Barotrauma.CargoManager.PurchaseItems ( Identifier  storeIdentifier,
List< PurchasedItem itemsToPurchase,
bool  removeFromCrate,
Client  client = null 
)

◆ SavePurchasedItems()

void Barotrauma.CargoManager.SavePurchasedItems ( XElement  parentElement)

◆ SellItems()

void Barotrauma.CargoManager.SellItems ( Identifier  storeIdentifier,
List< PurchasedItem itemsToSell,
Store.StoreTab  sellingMode 
)

◆ SetItemsInBuyCrate()

void Barotrauma.CargoManager.SetItemsInBuyCrate ( Dictionary< Identifier, List< PurchasedItem >>  items)

◆ SetItemsInSubSellCrate()

void Barotrauma.CargoManager.SetItemsInSubSellCrate ( Dictionary< Identifier, List< PurchasedItem >>  items)

◆ SetPurchasedItems()

void Barotrauma.CargoManager.SetPurchasedItems ( Dictionary< Identifier, List< PurchasedItem >>  purchasedItems)

◆ SetSoldItems()

void Barotrauma.CargoManager.SetSoldItems ( Dictionary< Identifier, List< SoldItem >>  items)

Member Data Documentation

◆ MaxQuantity

const int Barotrauma.CargoManager.MaxQuantity = 100
static

◆ OnItemsInBuyCrateChanged

readonly NamedEvent<CargoManager> Barotrauma.CargoManager.OnItemsInBuyCrateChanged = new NamedEvent<CargoManager>()

◆ OnItemsInSellCrateChanged

readonly NamedEvent<CargoManager> Barotrauma.CargoManager.OnItemsInSellCrateChanged = new NamedEvent<CargoManager>()

◆ OnItemsInSellFromSubCrateChanged

readonly NamedEvent<CargoManager> Barotrauma.CargoManager.OnItemsInSellFromSubCrateChanged = new NamedEvent<CargoManager>()

◆ OnPurchasedItemsChanged

readonly NamedEvent<CargoManager> Barotrauma.CargoManager.OnPurchasedItemsChanged = new NamedEvent<CargoManager>()

◆ OnSoldItemsChanged

readonly NamedEvent<CargoManager> Barotrauma.CargoManager.OnSoldItemsChanged = new NamedEvent<CargoManager>()

Property Documentation

◆ ItemsInBuyCrate

Dictionary<Identifier, List<PurchasedItem> > Barotrauma.CargoManager.ItemsInBuyCrate = new Dictionary<Identifier, List<PurchasedItem>>()
get

◆ ItemsInSellCrate

Dictionary<Identifier, List<PurchasedItem> > Barotrauma.CargoManager.ItemsInSellCrate = new Dictionary<Identifier, List<PurchasedItem>>()
get

◆ ItemsInSellFromSubCrate

Dictionary<Identifier, List<PurchasedItem> > Barotrauma.CargoManager.ItemsInSellFromSubCrate = new Dictionary<Identifier, List<PurchasedItem>>()
get

◆ PurchasedItems

Dictionary<Identifier, List<PurchasedItem> > Barotrauma.CargoManager.PurchasedItems = new Dictionary<Identifier, List<PurchasedItem>>()
get

◆ SoldItems

Dictionary<Identifier, List<SoldItem> > Barotrauma.CargoManager.SoldItems = new Dictionary<Identifier, List<SoldItem>>()
get