Пример #1
0
        //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);
            }
        }
Пример #2
0
 //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);
         }
     }
 }
Пример #3
0
 public static void ReleaseObject(Corps corps)
 {
     corps.getPopUnit().demobilize();
     corps.deleteData();
     lock (_available)
     {
         _available.Add(corps);
         _inUse.Remove(corps);
     }
 }
Пример #4
0
 public void removeCorps(Corps corps)
 {
     personal.Remove(corps.getPopUnit());
 }
Пример #5
0
 internal void remove(Corps corps)
 {
     personal.Remove(corps.getPopUnit());
 }