My Project
 All Classes Namespaces Functions Variables
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
Interaction.Interaction Class Reference

List of all members.

Public Member Functions

def __init__
def interact
def introduction
def catchingUp

Static Public Member Functions

def getInteractionById

Public Attributes

 interactionid
 The interaction's type.
 fconditions
 Boolean function that returns True for when the consequences are met and False when not.
 fconsequences
 Function to be called when the return value of self.fconditions is True.

Static Public Attributes

list interactions = []
 Static List of all interactions.

Detailed Description

A class that treats the interaction between players and other GameObjects
Basically its a set of conditions and one of consequences. When the conditions
are met, the consequences happen

Constructor & Destructor Documentation

def Interaction.Interaction.__init__ (   self,
  interactionid,
  fconditions,
  fconsequences 
)
Interaction.__init__(self, interactiontype, fconditions, fconsequeces)
Initialization function for an Interaction object

interactiontype is the type of the interaction.
interactiontype MUST be in Interaction.possibletypes.

fconditions is a boolean function that returns True when the interaction occurs

fconsequences is a function that computes the consequences of the interaction

In short, when fconditions returns True, fconsequences is called

Member Function Documentation

Generates a JSON friendly dictionary with
all the object's attributes and values.
This function is intended as a update on the object's state,
sent to receivers that are already able to identify the object.
def Interaction.Interaction.interact (   self,
  lcond,
  lcons 
)
Interaction.interact(self, lcond, lcons)

Function that checks if the conditions are meant and, if so, executes the interaction

lcond is a parameter list to be passed to self.fconditions
lcons is a parameter list to be passed to self.fconsequences
Generates a JSON friendly dictionary with
all the object's attributes and values.
This function is intended as a first introduction of the object,
to receivers that are unaware of its existence.

Member Data Documentation

The interaction's type.

One of the possible types in Interaction.possibletypes


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables