Ejemplo n.º 1
0
 /// <summary>
 /// Suranda veikėjų rinktinę ir ideda į konteinerius
 /// </summary>
 /// <param name="branchContainer">Filialų konteineris</param>
 /// <param name="intelligenceLimit">Intelekto nurodytas dydis</param>
 /// <param name="damagePoint">Žalos taškų nurodytas dydis</param>
 /// <param name="selectionHeroes">Herojų rinktinės konteineris</param>
 /// <param name="selectionNPCs">NPCs rinktinės konteineris</param>
 public static void GeneralSelection(BranchContainer branchContainer, int intelligenceLimit, int damagePoint, out PlayerContainer selectionHeroes, out PlayerContainer selectionNPCs)
 {
     selectionHeroes = new PlayerContainer();
     selectionNPCs   = new PlayerContainer();
     for (int i = 0; i < branchContainer.Count; i++)
     {
         for (int j = 0; j < branchContainer.GetBranch(i).Players.Count; j++)
         {
             if ((branchContainer.GetBranch(i).GetPlayer(j) is Hero) && (branchContainer.GetBranch(i).GetPlayer(j) as Hero).Intelligence > intelligenceLimit)
             {
                 selectionHeroes.AddPlayer(branchContainer.GetBranch(i).GetPlayer(j));
             }
         }
         for (int j = 0; j < branchContainer.GetBranch(i).Players.Count; j++)
         {
             if ((branchContainer.GetBranch(i).GetPlayer(j) is NPC) && (branchContainer.GetBranch(i).GetPlayer(j) as NPC).Damage <= damagePoint)
             {
                 selectionNPCs.AddPlayer(branchContainer.GetBranch(i).GetPlayer(j));
             }
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Suranda veikėjus tankus ir ideda juos į konteinerius
 /// </summary>
 /// <param name="branchContainer">Filialų konteineris</param>
 /// <param name="filteredTanksHeroes">Herojų tankų konteineris</param>
 /// <param name="filteredTanksNPCs">Herojų NPCs konteineris</param>
 public static void FindTanks(BranchContainer branchContainer, out PlayerContainer filteredTanksHeroes, out PlayerContainer filteredTanksNPCs)
 {
     filteredTanksHeroes = new PlayerContainer();
     filteredTanksNPCs   = new PlayerContainer();
     for (int i = 0; i < branchContainer.Count; i++)
     {
         for (int j = 0; j < branchContainer.GetBranch(i).Players.Count; j++)
         {
             if ((branchContainer.GetBranch(i).GetPlayer(j) is Hero) && branchContainer.GetBranch(i).GetPlayer(j).IsTank(TankHealth, TankDefence))
             {
                 filteredTanksHeroes.AddPlayer(branchContainer.GetBranch(i).GetPlayer(j));
             }
         }
         for (int j = 0; j < branchContainer.GetBranch(i).Players.Count; j++)
         {
             if ((branchContainer.GetBranch(i).GetPlayer(j) is NPC) && branchContainer.GetBranch(i).GetPlayer(j).IsTank(TankHealth, TankDefence))
             {
                 filteredTanksNPCs.AddPlayer(branchContainer.GetBranch(i).GetPlayer(j));
             }
         }
     }
 }