private void initBoard(List<Hero> heroes, Villain villain, GameEnvironment env) { drawNPCBoard(villain, env); for (int ii = 0; ii < heroes.Count; ii++) { drawHeroTemplate(heroes[ii], HERO_ROW+ ii); } }
//private static bool getWinCon() //{ // return villain.lifeTotal <= 0; //} public static void initPlayers(List<string> heroesStr, string villainStr, string envStr) { for (int i = 0; i < heroesStr.Count; i++) { Hero newHero = (Hero)getClassFromString(heroesStr[i]); //TODO testing code to initialize certain cards in a players hand newHero.hand.RemoveRange(0, 2); if (newHero.GetType().Equals(typeof(Haka))) { //newHero.hand.Add(new Card("\\Images\\Hero\\Haka\\2-SavageMana.png")); newHero.hand.Add(new Card("\\Images\\Hero\\Haka\\3-Rampage.png")); newHero.hand.Add(new Card("\\Images\\Hero\\Haka\\2-GroundPound.png")); newHero.hand.Add(new Card("\\Images\\Hero\\Haka\\3-HakaOfBattle.png")); newHero.hand.Add(new Card("\\Images\\Hero\\Haka\\3-TaMoko.png")); //newHero.hand.Add(new Card("C:\\Users\\rujirasl.000\\Documents\\GitHub\\SentinelsOfTheMultiverse\\SentinelsOfTheMultiverse\\SentinelsOfTheMultiverse\\Images\\Hero\\Haka\\3-EnduringIntercession.png")); } heroes.Add(newHero); } villain = (Villain)getClassFromString(villainStr); environment = (GameEnvironment)getClassFromString(envStr); }
private void drawNPCBoard(Villain villain, GameEnvironment env) { string villainName = villain.getCharacterName(); Card villainCard = new Card(VILLAIN_IMAGE_PATH + villainName + "/NonPlayable/" + villainName + "_initial.png"); villainCard.MouseDown += new MouseButtonEventHandler(Mouse_Click_Listener); Card villainDeck = new Card(VILLAIN_IMAGE_PATH + villainName + "/NonPlayable/" + villainName + "_back.png"); villainDeck.MouseDown += new MouseButtonEventHandler(Mouse_Click_Listener); Card villainInst = new Card(VILLAIN_IMAGE_PATH + villainName + "/NonPlayable/" + villainName + "_instr_front.png"); villainInst.MouseDown += new MouseButtonEventHandler(Mouse_Click_Listener); Card envDeck = new Card("Images/Environment/" + env.characterName + "/NonPlayable/" + "insula_primus_back.png"); envDeck.MouseDown += new MouseButtonEventHandler(Mouse_Click_Listener); Utility.addElementToGrid(villainCard, VILLAIN_ROW, CHARACTER_COLUMN, gridLayout); Utility.addElementToGrid(villainInst, VILLAIN_ROW, INSTRUCTION_COLUMN, gridLayout); Utility.addElementToGrid(villainDeck, VILLAIN_ROW, DECK_COLUMN, gridLayout); Utility.addElementToGrid(envDeck, ENVIRONMENT_ROW, DECK_COLUMN, gridLayout); addHealthLabel(villain, VILLAIN_ROW); Card envGraveyard = new Card(GRAVEYARD_IMAGE_PATH); envGraveyard.MouseDown += new MouseButtonEventHandler(Mouse_Click_Listener); Utility.addElementToGrid(envGraveyard, ENVIRONMENT_ROW, GRAVEYARD_COLUMN, gridLayout); Card villainGraveYard = new Card(GRAVEYARD_IMAGE_PATH); villainGraveYard.MouseDown += new MouseButtonEventHandler(Mouse_Click_Listener); Utility.addElementToGrid(villainGraveYard, VILLAIN_ROW, GRAVEYARD_COLUMN, gridLayout); }
public static void TearDownGameEngine() { playerTurn = 0; isFirstTurn = true; villain = null; heroes = new List<Hero>(); environment = null; }