예제 #1
0
 /// <summary>
 /// Remove the Villager from the Job
 /// </summary>
 /// <param name="person"></param>
 internal void RemovePerson(Villager person)
 {
     if (person == null) throw new ArgumentNullException();
     if (_workers.Contains(person))
     {
         person.setJob(null);
         _workerListChanged = true;
         _workers.Remove(person);
         //_gold = ModifyGoldGeneration();//not usefull here really
     }
     else throw new InvalidOperationException();
 }
예제 #2
0
 public bool RemovePerson2(Villager person)
 {
     if (person == null)
         return false;
     if (_workers.Contains(person))
     {
         if ((person.Health & Healths.HERETIC) != 0)
         {
             removeHereticWorker();
         }
         person.setJob(null);
         _workerListChanged = true;
         _workers.Remove(person);
         //_gold = ModifyGoldGeneration();//not usefull here really
         return true;
     }
     else
         return false;
 }
예제 #3
0
 /// <summary>
 /// Add a Villager to the Job
 /// </summary>
 /// <param name="person"></param>
 internal void AddPerson(Villager person)
 {
     if (!AddPersonPrerequisites())
         return;
     if (person == null) throw new ArgumentNullException();
     if (!_workers.Contains(person))
     {
         person.setJob(this);
         _workerListChanged = true;
         _workers.Add(person);
         if ((person.Health & Healths.HERETIC) != 0)
         {
             addHereticWorker();
         }
         Debug.Assert(_workers.Contains(person), "(AddPerson) the person was not added Oo");
         //_gold = ModifyGoldGeneration();//not usefull here really...
     }
     else throw new InvalidOperationException();
 }
예제 #4
0
 public bool AddPerson2(Villager person)
 {
     if (!AddPersonPrerequisites())
         return false;
     if (person == null)
         return false;
     if (!_workers.Contains(person))
     {
         person.setJob(this);
         _workerListChanged = true;
         _workers.Add(person);
         if ((person.Health & Healths.HERETIC) != 0)
         {
             addHereticWorker();
         }
         Debug.Assert(_workers.Contains(person), "(AddPerson) the person was not added Oo");
         //_gold = ModifyGoldGeneration();//not usefull here really...
         return true;
     }
     else
         return false;
 }