private static void Main(string[] args) { Console.WriteLine("Setup gameConfig"); AbstractAgent agent1 = null; AbstractAgent agent2 = null; if (args[0].Equals("EVA")) { Console.WriteLine("EVA loaded for agent 1"); agent1 = new EVA(); ((EVA)agent1).InitializeAgent(); } else if (args[0].Equals("AlvaroAgent")) { agent1 = new AlvaroAgent(); ((AlvaroAgent)agent1).InitializeAgent(); } if (args[3].Equals("EVA")) { Console.WriteLine("EVA loaded for agent 2"); agent2 = new EVA(); ((EVA)agent2).InitializeAgent(); } else if (args[3].Equals("AlvaroAgent")) { agent2 = new AlvaroAgent(); ((AlvaroAgent)agent2).InitializeAgent(); } Console.WriteLine("Agents loaded!"); var gameConfig = new GameConfig() { StartPlayer = -1, // set to -1 should randomize starting player every game // Player1HeroClass = CardClass.MAGE, // Player2HeroClass = CardClass.MAGE, FillDecks = true, Shuffle = true, Logging = false, Player1HeroClass = stringToCardClass(args[2]), Player2HeroClass = stringToCardClass(args[5]), // FillDecks = false, // Logging = false, Player1Deck = stringToDeck(args[1]), Player2Deck = stringToDeck(args[4]) //RenoKazakusMage }; int numGames = Int32.Parse(args[6]); Console.WriteLine("Setup POGameHandler"); var gameHandler = new POGameHandler(gameConfig, agent1, agent2, repeatDraws: false); Console.WriteLine("Simulate Games"); //gameHandler.PlayGame(); gameHandler.PlayGames(nr_of_games: numGames, addResultToGameStats: true, debug: false); GameStats gameStats = gameHandler.getGameStats(); gameStats.printResults(); Console.WriteLine("Player 1: " + args[0] + " with deck " + args[1]); Console.WriteLine("Player 2: " + args[3] + " with deck " + args[4]); Console.WriteLine("Test successful"); // Console.ReadLine(); }
private void OnMouseDown() { if (book) { book = false; // if (Progress.lettersExerciseComplete) // { // if (A.destroyed == false && A.locked == false) // { // a.SetActive(true); // } // if (B.destroyed == false && B.locked == false) // { // b.SetActive(true); // } // if (C.destroyed == false && C.locked == false) // { // c.SetActive(true); // } // if (D.destroyed == false && D.locked == false) // { // d.SetActive(true); // } // if (E.destroyed == false && E.locked == false) // { // e.SetActive(true); // } // if (F.destroyed == false && F.locked == false) // { // f.SetActive(true); // } // if (G.destroyed == false && G.locked == false) // { // g.SetActive(true); // } // if (H.destroyed == false && H.locked == false) // { // h.SetActive(true); // } // if (I.destroyed == false && I.locked == false) // { // i.SetActive(true); // } // if (J.destroyed == false && J.locked == false) // { // j.SetActive(true); // } // if (K.destroyed == false && K.locked == false) // { // k.SetActive(true); // } // if (L.destroyed == false && L.locked == false) // { // l.SetActive(true); // } // if (M.destroyed == false && M.locked == false) // { // m.SetActive(true); // } // if (N.destroyed == false && N.locked == false) // { // n.SetActive(true); // } // if (O.destroyed == false && O.locked == false) // { // o.SetActive(true); // } // if (P.destroyed == false && P.locked == false) // { // p.SetActive(true); // } // if (Q.destroyed == false && Q.locked == false) // { // q.SetActive(true); // } // if (R.destroyed == false && R.locked == false) // { // r.SetActive(true); // } // if (S.destroyed == false && S.locked == false) // { // s.SetActive(true); // } // if (T.destroyed == false && T.locked == false) // { // t.SetActive(true); // } // if (U.destroyed == false && U.locked == false) // { // u.SetActive(true); // } // if (V.destroyed == false && V.locked == false) // { // v.SetActive(true); // } // if (W.destroyed == false && W.locked == false) // { // w.SetActive(true); // } // if (X.destroyed == false && X.locked == false) // { // x.SetActive(true); // } // if (Y.destroyed == false && Y.locked == false) // { // y.SetActive(true); // } // if (Z.destroyed == false && X.locked == false) // { // z.SetActive(true); // } // } // if (TestExerciseNext.catFlag) // { // CAT.SetActive(false); // } // if (TestExerciseNext.dogFlag) // { // DOG.SetActive(false); // } // if (TestExerciseNext.owlFlag) // { // OWL.SetActive(false); // } // if (TestExerciseNext.bearFlag || Progress.bear) // { // BEAR.SetActive(false); // } MONKEY.SetActive(false); DOOR.SetActive(false); RED.SetActive(false); BLUE.SetActive(false); GREEN.SetActive(false); YELLOW.SetActive(false); HELLO.SetActive(false); MAY.SetActive(false); EVA.SetActive(false); } else { book = true; // if (Progress.lettersExerciseComplete) // { // if (A.destroyed == false) // { // a.SetActive(false); // } // if (A.destroyed == false) // { // a.SetActive(false); // } // if (B.destroyed == false) // { // b.SetActive(false); // } // if (C.destroyed == false) // { // c.SetActive(false); // } // if (D.destroyed == false) // { // d.SetActive(false); // } // if (E.destroyed == false) // { // e.SetActive(false); // } // if (F.destroyed == false) // { // f.SetActive(false); // } // if (G.destroyed == false) // { // g.SetActive(false); // } // if (H.destroyed == false) // { // h.SetActive(false); // } // if (I.destroyed == false) // { // i.SetActive(false); // } // if (J.destroyed == false) // { // j.SetActive(false); // } // if (K.destroyed == false) // { // k.SetActive(false); // } // if (L.destroyed == false) // { // l.SetActive(false); // } // if (M.destroyed == false) // { // m.SetActive(false); // } // if (N.destroyed == false) // { // n.SetActive(false); // } // if (O.destroyed == false) // { // o.SetActive(false); // } // if (P.destroyed == false) // { // p.SetActive(false); // } // if (Q.destroyed == false) // { // q.SetActive(false); // } // if (R.destroyed == false) // { // r.SetActive(false); // } // if (S.destroyed == false) // { // s.SetActive(false); // } // if (T.destroyed == false) // { // t.SetActive(false); // } // if (U.destroyed == false) // { // u.SetActive(false); // } // if (V.destroyed == false) // { // v.SetActive(false); // } // if (W.destroyed == false) // { // w.SetActive(false); // } // if (X.destroyed == false) // { // x.SetActive(false); // } // if (Y.destroyed == false) // { // y.SetActive(false); // } // if (Z.destroyed == false) // { // z.SetActive(false); // } // } if (Progress.monkey) { MONKEY.SetActive(true); } if (Progress.door) { DOOR.SetActive(true); } if (Progress.red) { RED.SetActive(true); } if (Progress.blue) { BLUE.SetActive(true); } if (Progress.green) { GREEN.SetActive(true); } if (Progress.yellow) { YELLOW.SetActive(true); } if (Progress.hello) { HELLO.SetActive(true); } if (Progress.may) { MAY.SetActive(true); } if (Progress.eva) { EVA.SetActive(true); } } }
void Start() { book = true; CAT = GameObject.Find("CAT"); DOG = GameObject.Find("DOG"); OWL = GameObject.Find("OWL"); BEAR = GameObject.Find("BEAR"); MONKEY = GameObject.Find("MONKEY"); HELLO = GameObject.Find("HELLO"); DOOR = GameObject.Find("DOOR"); MAY = GameObject.Find("MAY"); EVA = GameObject.Find("EVA"); RED = GameObject.Find("RED"); BLUE = GameObject.Find("BLUE"); GREEN = GameObject.Find("GREEN"); YELLOW = GameObject.Find("YELLOW"); if (!Progress.cat) { CAT.SetActive(false); } if (!Progress.dog) { DOG.SetActive(false); } if (!Progress.bear) { BEAR.SetActive(false); } if (!Progress.monkey) { MONKEY.SetActive(false); } if (!Progress.owl) { OWL.SetActive(false); } if (!Progress.door) { DOOR.SetActive(false); } if (!Progress.red) { RED.SetActive(false); } if (!Progress.blue) { BLUE.SetActive(false); } if (!Progress.green) { GREEN.SetActive(false); } if (!Progress.yellow) { YELLOW.SetActive(false); } if (!Progress.hello) { HELLO.SetActive(false); } if (!Progress.may) { MAY.SetActive(false); } if (!Progress.eva) { EVA.SetActive(false); } a = GameObject.Find("a"); a.SetActive(false); b = GameObject.Find("b"); b.SetActive(false); c = GameObject.Find("c"); c.SetActive(false); d = GameObject.Find("d"); d.SetActive(false); e = GameObject.Find("e"); e.SetActive(false); f = GameObject.Find("f"); f.SetActive(false); g = GameObject.Find("g"); g.SetActive(false); h = GameObject.Find("h"); h.SetActive(false); i = GameObject.Find("i"); i.SetActive(false); j = GameObject.Find("j"); j.SetActive(false); k = GameObject.Find("k"); k.SetActive(false); l = GameObject.Find("l"); l.SetActive(false); m = GameObject.Find("m"); m.SetActive(false); n = GameObject.Find("n"); n.SetActive(false); o = GameObject.Find("o"); o.SetActive(false); p = GameObject.Find("p"); p.SetActive(false); q = GameObject.Find("q"); q.SetActive(false); r = GameObject.Find("r"); r.SetActive(false); s = GameObject.Find("s"); s.SetActive(false); t = GameObject.Find("t"); t.SetActive(false); u = GameObject.Find("u"); u.SetActive(false); v = GameObject.Find("v"); v.SetActive(false); w = GameObject.Find("w"); w.SetActive(false); x = GameObject.Find("x"); x.SetActive(false); y = GameObject.Find("y"); y.SetActive(false); z = GameObject.Find("z"); z.SetActive(false); }
private static void Main(string[] args) { Console.WriteLine("Setup gameConfig"); //todo: rename to Main /*GameConfig gameConfig = new GameConfig * { * StartPlayer = 1, * Player1HeroClass = CardClass.MAGE, * Player2HeroClass = CardClass.SHAMAN, * FillDecks = false, * Logging = false, * Player1Deck = Decks.RenoKazakusMage, * Player2Deck = Decks.MidrangeJadeShaman //RenoKazakusMage * }; * * * /*foreach (Card c in Cards.All) * { * Console.WriteLine(c.Name); * }*/ GameConfig gameConfig = gameConfigCoevoluationary(args); Console.WriteLine("Setup POGameHandler"); //AbstractAgent player1agent = new ParametricGreedyAgent(); //((ParametricGreedyAgent)player1agent).setAgeintWeightsFromString(args[2]); Console.WriteLine("Attempting to istantiate AlvaroMCTS agent..."); //AbstractAgent player1agent = new EVA(); //((EVA)player1agent).InitializeAgent(); AbstractAgent player1agent = new AlvaroAgent(); //AbstractAgent player2agent = new ParametricGreedyAgent(); //((ParametricGreedyAgent)player2agent).setAgeintWeightsFromString(args[5]); AbstractAgent player2agent = new EVA(); ((EVA)player2agent).InitializeAgent(); POGameHandler gameHandler = new POGameHandler(gameConfig, player1agent, player2agent, debug: false); gameConfig.StartPlayer = -1; //Pick random start player Console.WriteLine("STARTING GAMES"); int numGames = Int32.Parse(args[6]); gameHandler.PlayGames(numGames); GameStats gameStats = gameHandler.getGameStats(); //gameStats.printResults(); int p1wins = gameStats.PlayerA_Wins; int p2wins = gameStats.PlayerB_Wins; Console.WriteLine(p1wins + " " + p2wins + " " + numGames + " " + gameStats.PlayerA_TurnsToWin + " " + gameStats.PlayerA_TurnsToLose + " " + gameStats.PlayerA_HealthDifferenceWinning + " " + gameStats.PlayerA_HealthDifferenceLosing ); //Console.ReadLine(); }