//public Army(Army consolidatedArmy) : this(consolidatedArmy.getOwner()) //{ } //public static bool Any<TSource>(this IEnumerable<TSource> source); private void moveCorps(Corps item, Army destination) { if (personal.Remove(item.getPopUnit())) // don't remove this { destination.personal.Add(item.getPopUnit(), item); } }
//public Procent getAverageMorale() //{ // Procent result = new Procent(0); // int calculatedSize = 0; // foreach (var item in personal) // { // result.addPoportionally(calculatedSize, item.Value.getSize(), item.Value.getMorale()); // calculatedSize += item.Value.getSize(); // } // return result; //} public void add(Corps corpsToAdd) { if (corpsToAdd != null) { Corps found; if (personal.TryGetValue(corpsToAdd.getPopUnit(), out found)) // Returns true. { found.add(corpsToAdd); } else { personal.Add(corpsToAdd.getPopUnit(), corpsToAdd); } } }
public static void ReleaseObject(Corps corps) { corps.getPopUnit().demobilize(); corps.deleteData(); lock (_available) { _available.Add(corps); _inUse.Remove(corps); } }
public void removeCorps(Corps corps) { personal.Remove(corps.getPopUnit()); }
internal void remove(Corps corps) { personal.Remove(corps.getPopUnit()); }