Example #1
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            PlayerId playerId = (PlayerId)obj;

            return(id == playerId.id);
        }
Example #2
0
        public Game()
        {
            Constants.PopulateConstants(Input.ReadLine());

            Input input      = Input.ReadInput();
            int   numPlayers = input.GetInt();

            myId = new PlayerId(input.GetInt());

            Log.Open(myId.id);

            for (int i = 0; i < numPlayers; i++)
            {
                players.Add(Player._generate());
            }

            me      = players[myId.id];
            gameMap = GameMap._generate();
        }
Example #3
0
 private Player(PlayerId id, Shipyard shipyard)
 {
     this.id       = id;
     this.shipyard = shipyard;
 }