AIMA.Core.Search.Adversarial.GameState.put C# (CSharp) Method

put() public method

public put ( String key, Object value ) : void
key String
value Object
return void
        public void put(String key, Object value)
        {
            state.put(key, value);

        }
    }

Usage Example

Esempio n. 1
0
	public GameState getMove(GameState state, int x, int y) {
		GameState retVal = null;
		XYLocation loc = new XYLocation(x, y);
		List moves = getMoves(state);
		List newMoves = (List) moves.clone();
		if (moves.contains(loc)) {
			int index = newMoves.indexOf(loc);
			newMoves.remove(index);

			retVal = new GameState();

			retVal.put("moves", newMoves);
			TicTacToeBoard newBoard = getBoard(state).cloneBoard();
			if (getPlayerToMove(state) == "X") {
				newBoard.markX(x, y);
				retVal.put("player", "O");

			} else {
				newBoard.markO(x, y);
				retVal.put("player", "X");

			}
			retVal.put("board", newBoard);
			retVal.put("utility", new int(computeUtility(newBoard,
					getPlayerToMove(getState()))));
			retVal.put("level", new int(getLevel(state) + 1));
			// presentState = retVal;
		}
		return retVal;
	}
All Usage Examples Of AIMA.Core.Search.Adversarial.GameState::put