Esempio n. 1
0
        public Move EvaluateBoard(GamePhases currentPhase)
        {
            Coordinate sourceCoordinate    = Coordinate.Empty;
            Coordinate targetCoordinate    = Coordinate.Empty;
            IList <ValuedCoordinate> spots = new List <ValuedCoordinate>();

            foreach (Coordinate coordinate in this._protoBoard.GetAllCoordinates())
            {
                ProtoSpot protoSpot = this._protoBoard.GetCoordinate(coordinate.Level, coordinate.X, coordinate.Y);
                spots.Add(new ValuedCoordinate(coordinate, protoSpot));
            }

            switch (currentPhase)
            {
            case GamePhases.Set: {
                spots            = RunEvaluatorSet(spots, this._setEvaluators);
                targetCoordinate = PickRandomCoordinate(spots);
            }
            break;

            case GamePhases.Draw:
                break;

            case GamePhases.Jump:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(currentPhase), currentPhase, null);
            }

            return(new Move(sourceCoordinate, targetCoordinate));
        }
Esempio n. 2
0
 public ValuedCoordinate(Coordinate coordinate, ProtoSpot protoSpot)
 {
     this.Coordinate = coordinate;
     this.ProtoSpot  = protoSpot;
 }