Return the state that results from the agent moving in the given direction
in the given state. In order to avoid creating unnecessary objects, we
do not create a new state, but instead modify the old one. This
would have to change if the Environment needs to maintain a history
of states.