Movable¶
-
class
gamelib.Movable.
Movable
(**kwargs)¶ A class representing BoardItem capable of movements.
Movable subclasses
BoardItem
.Parameters: step (int) – the amount of cell a movable can cross in one turn. This class derive BoardItem and describe an object that can move or be moved (like a player or NPC). Thus this class implements BoardItem.can_move(). However it does not implement BoardItem.pickable() or BoardItem.overlappable()
This class contains a private member called _overlapping. This private member is used to store the reference to an overlappable object while a movable occupy its position. The Board then restore the overlapped object. You should let the Board class take care of that.
-
__init__
(**kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(**kwargs)Initialize self. can_move
()Movable implements can_move(). debug_info
()Return a string with the list of the attributes and their current value. display
()Print the model WITHOUT carriage return. has_inventory
()This is a virtual method that must be implemented in deriving class. overlappable
()This is a virtual method that must be implemented in deriving class. pickable
()This is a virtual method that must be implemented in deriving class. size
()This is a virtual method that must be implemented in deriving class. store_position
(row, column)Store the BoardItem position for self access. -