public Roster buildRosterFromConsole() { List <Monster> monsterList = new List <Monster>(); Roster playerOneRoster = new Roster(monsterList, "Player One"); Console.Write("How many Monsters does this roster need? (input an Integar)" + "\n"); String p1NumberOfMonsterS = Console.ReadLine(); int p1numMon = Convert.ToInt32(p1NumberOfMonsterS); for (int i = 0; i < p1numMon; i++) { Console.Write("Pick the Id of your first Monster" + "\n"); for (int b = 0; b < monsterDataBase.Count; b++) { Console.Write(" Monster: " + monsterDataBase.ElementAt(b).getName() + ", Id: " + monsterDataBase.ElementAt(b).getId() + "\n"); } string monsterIdString = Console.ReadLine(); int monsterId = Convert.ToInt32(monsterIdString); monsterId = monsterId - 1; playerOneRoster.addMonster(monsterDataBase.ElementAt(monsterId)); } for (int i = 0; i < playerOneRoster.count(); i++) { Console.Write("Player 1 Monster at:" + +i + " is called = " + playerOneRoster.returnMonsterAt(i).getName() + "\n"); for (int b = 0; b < playerOneRoster.returnMonsterAt(i).getMoveList().Count; b++) { Console.Write(playerOneRoster.returnMonsterAt(i).getName() + " move number " + b + " is named " + playerOneRoster.returnMonsterAt(i).getMoveList().ElementAt(b).getName() + "\n"); } } Console.ReadLine(); return(playerOneRoster); }
public Roster buildRosterFromConsole() { List<Monster> monsterList = new List<Monster>(); Roster playerOneRoster = new Roster(monsterList); Console.Write("How many Monsters does this roster need? (input an Integar)" + "\n"); String p1NumberOfMonsterS = Console.ReadLine(); int p1numMon = Convert.ToInt32(p1NumberOfMonsterS); for (int i = 0; i < p1numMon; i++) { Console.Write("Pick the Id of your first Monster" + "\n"); for (int b = 0; b < monsterDataBase.Count; b++) { Console.Write(" Monster: " + monsterDataBase.ElementAt(b).getName() + ", Id: " + monsterDataBase.ElementAt(b).getId() + ", Level: " + monsterDataBase.ElementAt(b).getlevel() + ", Type: " + monsterDataBase.ElementAt(b).getType()+", Health: "+ monsterDataBase.ElementAt(b).gethealth() + "\n"); } string monsterOrderString = Console.ReadLine(); int monsterOrder = Convert.ToInt32(monsterOrderString); monsterOrder = monsterOrder -1; playerOneRoster.addMonster(monsterDataBase.ElementAt(monsterOrder)); } for (int i = 0; i < playerOneRoster.count(); i++) { Console.Write("Player" + "\n"); //Monster at:" + +i + " is called = " + playerOneRoster.returnMonsterAt(i).getName() + "\n"); for (int b = 0; b < playerOneRoster.returnMonsterAt(i).getmoveList().Count; b++) { Console.Write(playerOneRoster.returnMonsterAt(i).getName() + " move number " + b + " is named " + playerOneRoster.returnMonsterAt(i).getmoveList().ElementAt(b).getName() + "\n"); } } Console.ReadLine(); return playerOneRoster; }
public void iterator(Roster playerOneRoster, Roster playerTwoRoster) { for (int i = 0; i < playerOneRoster.count(); i++) { if (playerOneRoster.returnMonsterAt(i).currentlyLiving() == true) { for (int a = 0; a < playerTwoRoster.count(); a++) { if (playerTwoRoster.returnMonsterAt(a).currentlyLiving() == true) { if (playerOneRoster.returnMonsterAt(i).getSpeed() > playerTwoRoster.returnMonsterAt(a).getSpeed()) { fightTwo(playerOneRoster.returnMonsterAt(i), playerTwoRoster.returnMonsterAt(a)); } else { fightTwo(playerTwoRoster.returnMonsterAt(a), playerOneRoster.returnMonsterAt(i)); } } else { Console.Write("Player Loses"); } } } } }
public void iterator(Roster playerOneRoster, Roster playerTwoRoster) { for(int i = 0; i < playerOneRoster.count(); i++) { if (playerOneRoster.returnMonsterAt(i).currentlyLiving() == true) { for(int a = 0; a < playerTwoRoster.count(); a++) { if (playerTwoRoster.returnMonsterAt(a).currentlyLiving() == true) { if (playerOneRoster.returnMonsterAt(i).getSpeed() > playerTwoRoster.returnMonsterAt(a).getSpeed()) { fightTwo(playerOneRoster.returnMonsterAt(i), playerTwoRoster.returnMonsterAt(a)); } else { fightTwo(playerTwoRoster.returnMonsterAt(a), playerOneRoster.returnMonsterAt(i)); } } else { Console.Write("Player Loses"); } } } } }