Skip to content
Snippets Groups Projects
Commit 723125e1 authored by Tessaris Sergio's avatar Tessaris Sergio
Browse files

Fixed leftovers from refactoring

parent 9289eba3
No related branches found
No related tags found
No related merge requests found
......@@ -165,7 +165,7 @@ class Hunter(Agent):
@property
def glitter(self):
return self.world.isGold(self.location)
return self.world.isGold(self.location) is not None
@property
def bump(self):
......@@ -212,7 +212,8 @@ class Hunter(Agent):
reward -= 1
elif action == self.Actions.GRAB:
reward -= 1
for gold in self.world.isGold(self.location):
gold = self.world.isGold(self.location)
if gold:
self._has_gold = True
self.world.removeObject(gold)
elif action == self.Actions.CLIMB:
......@@ -338,7 +339,7 @@ class WumpusWorld(GridWorld):
"""Return a gold if it's at the coordinate or None."""
return next(iter(self._objAt(Gold, pos)), None)
def isExit(self, pos: Coordinate) -> Iterable[Exit]:
def isExit(self, pos: Coordinate) -> Exit:
"""Return a exit if it's at the coordinate or None."""
return next(iter(self._objAt(Exit, pos)), None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment