def game(self): """Get the game object, will initilized this afterward""" if self._game is None: raise exceptions.NotInitalizedException( "Game haven't been initilized") return self._game
def _west(self): """ Move the player to the west direction. """ if self._game is None: raise exceptions.NotInitalizedException( "Game haven't been initilized") # Get the next location after moving to the north. self.location = self.game.move_west(self.location)
def location(self): """ Get the location of the player. Noted that it will in initilized when create the map Return 1. location (2 elements tuple) - the location of the player. """ if self._location is None: raise exceptions.NotInitalizedException("Location haven't been initilized") return self._location
def size(self): """Getter method for the size""" if self._size is None: raise exceptions.NotInitalizedException("The size isn't initilized.") return self._size