Skip to content

Commit

Permalink
update _did_step() with done parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Kautenja committed Aug 21, 2018
1 parent 133c1db commit bb8fe67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions nes_py/nes_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,11 @@ def step(self, action):
done = done or self._get_done()
# get the info for this step
info = self._get_info()
# if done terminate the collection early
if done:
break
# call the after step callback
self._did_step()
self._did_step(done)
# copy the screen from the emulator
self._copy_screen()
# increment the steps counter
Expand Down Expand Up @@ -308,8 +311,17 @@ def _get_info(self):
"""Return the info after a step occurs."""
return {}

def _did_step(self):
"""Handle any RAM hacking after a step occurs."""
def _did_step(self, done):
"""
Handle any RAM hacking after a step occurs.
Args:
done: whether the done flag is set to true
Returns:
None
"""
pass

def close(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def README():

setup(
name='nes_py',
version='0.11.1',
version='1.0.0',
description='An NES Emulator and OpenAI Gym interface',
long_description=README(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit bb8fe67

Please sign in to comment.