예제 #1
0
 private void CheckForJoin(Squad squad)
 {
     foreach (var friendSquad in new List <Squad>(SquadList.Where(s => !s.Id.Equals(squad.Id))))
     {
         var squadJoin = new Squad(squad, friendSquad);
         if (squadJoin.DispersionSquared < squad.DispersionSquared && SquadIdGenerator.HasCapacity)
         {
             Universe.Print($"We can join! Squads Id {squad.Id} and {friendSquad.Id}");
             ActionList.ActionCombineSquads(SquadList, SquadList.GetSquadById(squad.Id),
                                            SquadList.GetSquadById(friendSquad.Id), SquadIdGenerator);
         }
     }
 }