/** * <summary>Gets data related to what interactions are possible</summary> * <param name="rebuild">If True, the data will be rebuilt before being returned</param> * <returns>Data related to what interactions are possible</returns> */ public MatchingInvInteractionData GetMatchingInvInteractionData(bool rebuild) { if ((rebuild || matchingInvInteractionData == null) && invItem != null) { matchingInvInteractionData = new MatchingInvInteractionData(invItem); } return(matchingInvInteractionData); }
/** * <summary>A Constructor based on the linked InvItem's ID</summary> * <param name="_itemID">The ID number of the associated InvItem</param> * <param name="_count">The amount of that item to reference</param> */ public InvInstance(int _itemID, int _count = 1) { itemID = _itemID; invItem = (KickStarter.inventoryManager) ? KickStarter.inventoryManager.GetItem(itemID) : null; if (invItem != null) { invItem.Upgrade(); } Count = _count; invVars = new List <InvVar>(); cursorIcon = (invItem != null) ? new CursorIcon(invItem.cursorIcon) : null; matchingInvInteractionData = null; lastInteractionIndex = 0; GenerateDefaultProperties(); }
/** * <summary>A Constructor based on the linked InvItem</summary> * <param name="_itemID">The associated InvItem</param> * <param name="_count">The amount of that item to reference</param> */ public InvInstance(InvItem _invItem, int _count = 1) { invItem = _invItem; if (invItem != null) { invItem.Upgrade(); } itemID = (invItem != null) ? invItem.id : -1; Count = _count; invVars = new List <InvVar>(); cursorIcon = (invItem != null) ? new CursorIcon(invItem.cursorIcon) : null; matchingInvInteractionData = null; lastInteractionIndex = 0; GenerateDefaultProperties(); }
/** * <summary>A Constructor based on a Container item</summary> * <param name="containerItem">The Container item to create an instance from</param> */ public InvInstance(ContainerItem containerItem) { itemID = containerItem.ItemID; invItem = (KickStarter.inventoryManager) ? KickStarter.inventoryManager.GetItem(itemID) : null; if (invItem != null) { invItem.Upgrade(); } Count = containerItem.Count; invVars = new List <InvVar> (); cursorIcon = (invItem != null) ? new CursorIcon(invItem.cursorIcon) : null; matchingInvInteractionData = null; lastInteractionIndex = 0; GenerateDefaultProperties(); canBeAnimated = DetermineCanBeAnimated(); }
/** * <summary>A Constructor based on the linked InvItem's name</summary> * <param name="_itemName">The name number of the associated InvItem</param> * <param name="_count">The amount of that item to reference</param> */ public InvInstance(string _itemName, int _count = 1) { invItem = (KickStarter.inventoryManager) ? KickStarter.inventoryManager.GetItem(_itemName) : null; if (invItem != null) { invItem.Upgrade(); } Count = _count; itemID = (invItem != null) ? invItem.id : -1; invVars = new List <InvVar> (); cursorIcon = (invItem != null) ? new CursorIcon(invItem.cursorIcon) : null; matchingInvInteractionData = null; lastInteractionIndex = 0; GenerateDefaultProperties(); canBeAnimated = DetermineCanBeAnimated(); }
/** * <summary>A Constructor that copies values of another class instance</summary> * <param name="invInstance">The class instance to copy from</param> */ public InvInstance(InvInstance invInstance) { if (IsValid(invInstance)) { itemID = invInstance.itemID; invItem = invInstance.invItem; invVars = invInstance.invVars; cursorIcon = invInstance.cursorIcon; matchingInvInteractionData = invInstance.matchingInvInteractionData; lastInteractionIndex = invInstance.lastInteractionIndex; Count = invInstance.count; } else { itemID = -1; count = -1; invItem = null; invVars = null; cursorIcon = null; matchingInvInteractionData = null; lastInteractionIndex = 0; } }