public CustomizationSlot(WeaponPart.PartType type, Rectangle position) { this.position = position; this.Type = type; buttons = new List <Button>(); partInfo = "no info :("; }
public Item PartOfType(WeaponPart.PartType t) { foreach (Item p in parts) { if (p.Properties.WeaponPart.Type == t) { return(p); } } return(null); }
public bool ContainsType(WeaponPart.PartType t) { foreach (Item p in parts) { if (p.Properties.WeaponPart.Type == t) { return(true); } } return(false); }
/// <summary> /// tries to remove the part of the specified type. Returns null if no part was found, otherwise returns the removed part. /// </summary> /// <param name="type"></param> /// <returns></returns> public Item RemovePart(WeaponPart.PartType type) { foreach (Item p in parts) { if (p.Properties.WeaponPart.Type == type) { parts.Remove(p); CalculateValues(); return(p); } } return(null); }