示例#1
0
 public Pile(BugTeam team,
             int beetleCount      = 2,
             int grasshopperCount = 3,
             int ladyBugCount     = 0,
             int mosquitoCount    = 0,
             int pillBugCount     = 0,
             int queenBeeCount    = 1,
             int soldierAntCount  = 3,
             int spiderCount      = 2)
 {
     _team = team;
     while (beetleCount > 0 || grasshopperCount > 3 || ladyBugCount > 0 || mosquitoCount > 0 || pillBugCount > 0 || queenBeeCount > 0 || soldierAntCount > 0 || spiderCount > 0)
     {
         if (beetleCount > 0)
         {
             if (Beetles == null)
             {
                 Beetles = new Stack <Beetle>();
                 _stackCount++;
             }
             Beetles.Push(new Beetle(_team));
             beetleCount--;
         }
         if (grasshopperCount > 0)
         {
             if (Grasshoppers == null)
             {
                 Grasshoppers = new Stack <Grasshopper>();
                 _stackCount++;
             }
             Grasshoppers.Push(new Grasshopper(_team));
             grasshopperCount--;
         }
         if (ladyBugCount > 0)
         {
             if (LadyBugs == null)
             {
                 LadyBugs = new Stack <LadyBug>();
                 _stackCount++;
             }
             LadyBugs.Push(new LadyBug(_team));
             ladyBugCount--;
         }
         if (mosquitoCount > 0)
         {
             if (Mosquitos == null)
             {
                 Mosquitos = new Stack <Mosquito>();
                 _stackCount++;
             }
             Mosquitos.Push(new Mosquito(_team));
             mosquitoCount--;
         }
         if (pillBugCount > 0)
         {
             if (PillBugs == null)
             {
                 PillBugs = new Stack <PillBug>();
                 _stackCount++;
             }
             PillBugs.Push(new PillBug(_team));
             pillBugCount--;
         }
         if (queenBeeCount > 0)
         {
             if (QueenBees == null)
             {
                 QueenBees = new Stack <QueenBee>();
                 _stackCount++;
             }
             QueenBees.Push(new QueenBee(_team));
             queenBeeCount--;
         }
         if (soldierAntCount > 0)
         {
             if (SoldierAnts == null)
             {
                 SoldierAnts = new Stack <SoldierAnt>();
                 _stackCount++;
             }
             SoldierAnts.Push(new SoldierAnt(_team));
             soldierAntCount--;
         }
         if (spiderCount > 0)
         {
             if (Spiders == null)
             {
                 Spiders = new Stack <Spider>();
                 _stackCount++;
             }
             Spiders.Push(new Spider(_team));
             spiderCount--;
         }
     }
 }
示例#2
0
 public QueenBee(BugTeam bugTeam)
 {
     Type = BugType.QueenBee;
     Team = bugTeam;
 }
示例#3
0
 public LadyBug(BugTeam bugTeam)
 {
     Type = BugType.LadyBug;
     Team = bugTeam;
 }
示例#4
0
 public Spider(BugTeam bugTeam)
 {
     Type = BugType.Spider;
     Team = bugTeam;
 }
示例#5
0
 public SoldierAnt(BugTeam bugTeam)
 {
     Type = BugType.SoldierAnt;
     Team = bugTeam;
 }
示例#6
0
 public Mosquito(BugTeam bugTeam)
 {
     Type = BugType.Mosquito;
     Team = bugTeam;
 }
示例#7
0
 public Grasshopper(BugTeam bugTeam)
 {
     Type = BugType.Grasshopper;
     Team = bugTeam;
 }
示例#8
0
 public PillBug(BugTeam bugTeam)
 {
     Type = BugType.PillBug;
     Team = bugTeam;
 }
示例#9
0
 public Beetle(BugTeam bugTeam)
 {
     Type = BugType.Beetle;
     Team = bugTeam;
 }