public Ammunition(SuppliesStorage start, Enum type, String name) { Used = false; HeldBy = start; Caliber = type; Name = name; }
public SubUnit(string name) { Name = name; Storage = new SuppliesStorage(1000); SoftAttack = 0; HardAttack = 0; Piercing = 0; Integrity = 0; Organization = 0; Speed = 0; Armor = 0; Readiness = 0; Entrenchment = 0; Defense = 0; CombatWidth = 0; }
public List <Equipment> takeItem(String name, int amount, Unit unit = null, SuppliesStorage newStorage = null) { List <Equipment> returnList = new List <Equipment>(); int amountCount = 0; foreach (Equipment i in storage) { if ((i.Name == name) && (amountCount < amount)) { returnList.Add(i); if (unit != null) { unit.Storage.addItem(i); } else if (newStorage != null) { newStorage.addItem(i); } else { throw new ArgumentException("Both unit and newStorage cannot be null"); } weight = weight - i.Weight; amountCount++; if (amountCount == amount) { break; } } } if (returnList.Count() > 0) { return(returnList); } return(null); }
public MapSpace(int X, int Y) { this.X = X; this.Y = Y; Storage = new SuppliesStorage(double.MaxValue); }