public void RemoveDecoration(string imageID) { for (DollPart index = DollPart.NONE; index < DollPart._COUNT; ++index) { var x = GetDecorations(index); if (null != x && x.Remove(imageID) && 0 >= x.Count) { m_Decorations ![(int)index] = null;
public void AddDecoration(DollPart part, string imageID) { List <string> partList = GetDecorations(part); if (partList == null) { partList = m_Decorations[(int)part] = new List <string>(1); } partList.Add(imageID); }
public void AddDecoration(DollPart part, string imageID) { #if DEBUG if (null == m_Decorations) { throw new ArgumentNullException(nameof(m_Decorations)); } #endif (GetDecorations(part) ?? (m_Decorations[(int)part] = new List <string>(1))).Add(imageID); }
public ItemModel(Gameplay.GameItems.IDs _id, string aName, string theNames, string imageID, string flavor = "", DollPart part = DollPart.NONE, bool no_autoequip = false) { ID = _id; SingleName = aName; PluralName = theNames; ImageID = imageID; FlavorDescription = flavor; // if we are not equippable, then there is no operational difference whether we auto-equip or not. DontAutoEquip = DollPart.NONE == (EquipmentPart = part) || no_autoequip; }
public void SetDollPart(DollPart part) { DollPart = part; if (mesh != null) { Destroy(mesh); } mesh = Instantiate(part.Go, transform); }
public Item GetEquippedItem(DollPart part) { if (m_Inventory == null || part == DollPart.NONE) { return(null); } foreach (Item it in m_Inventory.Items) { if (it.EquippedPart == part) { return(it); } } return(null); }
public int CountDecorations(DollPart part) { List <string> partList = GetDecorations(part); return(partList == null ? 0 : partList.Count); }
public List <string> GetDecorations(DollPart part) { return(m_Decorations[(int)part]); }
public void RemoveDecoration(DollPart part) { m_Decorations[(int)part] = null; }
public Item(ItemModel model) { m_ModelID = model.ID; m_Quantity = 1; m_EquipedPart = DollPart.NONE; }
public ItemTrackerModel(Gameplay.GameItems.IDs _id, string aName, string theNames, string imageID, TrackingFlags tracking, int maxBatteries, DollPart part, string flavor) : base(_id, aName, theNames, imageID, flavor, part, true) { Tracking = tracking; MaxBatteries = maxBatteries; }
public List <string>?GetDecorations(DollPart part) { return(null != m_Decorations ? m_Decorations[(int)part] : null); }