List<Command> AI.spawn(int resources){ List<Command> commands = new List<Command> (); while (resources > unitData[3].getCost()) { Command spawnc = new Command(); spawnc.addSpawn (3); commands.Add (spawnc); resources -= unitData[3].getCost(); } return commands; }
List<Command> AI.spawn(int resources){ List<Command> commands = new List<Command> (); int unitType = 2; while (resources > 0) { Command spawnc = new Command(); spawnc.addSpawn (unitType); commands.Add (spawnc); resources -= unitData[unitType].getCost(); unitType++; if(unitType >= 5){ unitType = 2; } } return commands; }