Example #1
0
        public SpleefPlayerInfo Clone()
        {
            var clone = new SpleefPlayerInfo(Name.Clone().ToString(), ID);

            clone.CurrentLocation = this.CurrentLocation;
            clone.PlayerColor     = this.PlayerColor;
            return(clone);
        }
Example #2
0
        public IEnumerable <Point> GetValidMoves(List <SpleefPlayerInfo> players, SpleefBoard.SpleefBoard board,
                                                 SpleefPlayerInfo currentPlayer)
        {
            var alivePlayers      = GetAlivePlayers(players, board);
            var otherAlivePlayers = alivePlayers.Where(x => x.ID != currentPlayer.ID).ToList();

            foreach (var point in GetAllMoves(board, currentPlayer.CurrentLocation))
            {
                if (board[point.X, point.Y].IsSolid && otherAlivePlayers.All(x => x.CurrentLocation != point))
                {
                    yield return(point);
                }
            }
        }
 public SpleefPlayer(string name, int id)
 {
     Info = new SpleefPlayerInfo(name, id);
 }
 public SpleefPlayer()
 {
     Info = new SpleefPlayerInfo();
 }