Beispiel #1
0
        //Monteur Partie
        unsafe public IGame buildGame(string pseudo1, IFaction faction1, string pseudo2, IFaction faction2)
        {
            IPlayer Player1 = new Player(faction1, this.nbUnits, pseudo1);
            IPlayer Player2 = new Player(faction2, this.nbUnits, pseudo2);

            WrapperAlgo wp        = new WrapperAlgo();
            int *       posPlayer = wp.placingPlayer(this.map.getSize());

            for (int i = 0; i < this.nbUnits; i++)
            {
                IUnit u = Player1.getUnit(i);
                this.map.getTile(posPlayer[0], posPlayer[1]).addUnit(u);
                IUnit v = Player2.getUnit(i);
                this.map.getTile(posPlayer[2], posPlayer[3]).addUnit(v);
            }

            return(new Game(this.nbRounds, Player1, Player2, this.map));
        }