Exemplo n.º 1
0
 public CustomizationSlot(WeaponPart.PartType type, Rectangle position)
 {
     this.position = position;
     this.Type     = type;
     buttons       = new List <Button>();
     partInfo      = "no info :(";
 }
Exemplo n.º 2
0
 public Item PartOfType(WeaponPart.PartType t)
 {
     foreach (Item p in parts)
     {
         if (p.Properties.WeaponPart.Type == t)
         {
             return(p);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
 public bool ContainsType(WeaponPart.PartType t)
 {
     foreach (Item p in parts)
     {
         if (p.Properties.WeaponPart.Type == t)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 4
0
 /// <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);
 }