예제 #1
0
        private Field SetupPlayerField(char item)
        {
            var piece = new PlayerPiece(item.ToString());
            var field = new StartField();

            piece.StartField = field;

            piece.PieceField = field;
            field.Pieces.Add(piece);

            if (int.TryParse(item.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var toInt))
            {
                // subtract one because the config file starts from 1 and not 0
                _players[toInt - 1].PlayerPieces.Add(piece);
                _players[toInt - 1].StartFields.Add(field);
                piece.PieceOwner = _players[toInt - 1];
            }

            return(field);
        }
예제 #2
0
 public bool OwnsPiece(PlayerPiece piece)
 {
     return(PlayerPieces.Contains(piece));
 }