Actionable

class gamelib.Immovable.Actionable(**kwargs)

This class derives Immovable. It adds the ability to an Immovable BoardItem to be triggered and execute some code.

Parameters:
  • action (function) – the reference to a function (Attention: no parentheses at the end of the function name).
  • action_parameters (list) – the parameters to the action function.
  • perm (Constants) – The permission that defines what types of items can actually activate the actionable. The permission has to be one of the permissions defined in Constants

On top of these parameters Actionable accepts all parameters from Immovable and therefor from BoardItem.

Note

The common way to use this class is to use GenericActionableStructure. Please refer to GenericActionableStructure for more details.

__init__(**kwargs)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(**kwargs) Initialize self.
activate() This function is calling the action function with the action_parameters.
can_move() Return the capability of moving of an item.
debug_info() Return a string with the list of the attributes and their current value.
display() Print the model WITHOUT carriage return.
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.
restorable() This is a virtual method that must be implemented in deriving class.
size() Return the size of the Immovable Item.
store_position(row, column) Store the BoardItem position for self access.