예제 #1
0
파일: Game.cs 프로젝트: eske/INSAWars
        /// <summary>
        /// Creates a new game with the given map and the given players.
        /// Players play turn by turn until only one player remains.
        /// </summary>
        /// <param name="map">Map of the game.</param>
        /// <param name="players">Players of the game.</param>
        public Game(Map map, List<Player> players)
        {
            this.players = players;
            this.alivePlayers = new Queue<Player>(players);

            this.map = map;

            this._over = false;
            this.nbTurns = 0;
        }
예제 #2
0
 /// <summary>
 /// Initializes a player with default values : a teacher and a student.
 /// </summary>
 /// <param name="player"></param>
 /// <param name="map"></param>
 private void initPlayer(Player player, Map map)
 {
     Case position = map.FreePosition;
     Teacher teacher = player.Civilization.UnitFactory.CreateTeacher(position, player);
     Student student = player.Civilization.UnitFactory.CreateStudent(position, player);
     player.AddUnit(teacher);
     position.AddUnit(teacher);
     player.AddUnit(student);
     position.AddUnit(student);
 }