Odyssey::InputCombo Class Reference

Acts as the base class for all input combos. More...

#include <InputCombo.h>

Inheritance diagram for Odyssey::InputCombo:

Odyssey::AndInputCombo Odyssey::TimedInputCombo Odyssey::TriggerInputCombo List of all members.

Public Types

typedef ActionMapInputAdapter::AttributeIterator AttributeIterator
typedef ActionMapInputAdapter::ConstAttributeIterator ConstAttributeIterator

Public Member Functions

 InputCombo ()
 Constructs a new empty combo.
bool containsFilter (const String &name) const
 Returns true of a filter with the given name exists.
void setFilter (const String &name, InputAdapter *filter, bool manage=true)
 Add a new filter to this combo's action map.
void setFilter (const String &name, InputAdapterPtr filter)
 Add a new filter to this combo's action map.
void setFilter (const String &name, InputCombo *combo)
 Add a new filter in the form of another combo.
void removeFilter (const String &name)
 Removes the given filter from this combo's action map.
void clearFilters ()
 Clears all filters from this combo's action map.
void registerAdapter (MultiInputAdapter &adapter)
 Registers this combo's action map with the given adapter.
void registerAdapter (InputSystem &system)
 Registers this combo's action map with the input system.
void unregisterAdapter (MultiInputAdapter &adapter)
 Unregisters the combo's action map from the given adapter.
void unregisterAdapter (InputSystem &system)
 Unregisters the combo's action map from the input system.
virtual void onEvent (const String &action)
 The callback for this combo's action mapping.
virtual void onCombo ()
 This function is meant as the callback when the combo is invoked.
void setAttribute (const String &name, const Variable &attr)
 Sets an attribute for the adapter.
Variable getAttribute (const String &name) const
 Gets an attribute for the adapter.
void removeAttribute (const String &name)
 Removes an attribute.
void clearAttributes ()
 Clears all attributes.
size_t getAttributeCount () const
 Returns the number of stored attributes.
AttributeIterator getAttributeIterator ()
 Returns an iterator over the stored attributes.
ConstAttributeIterator getAttributeIterator () const
 Returns an iterator over the stored attributes.

Public Attributes

Delegate ComboTriggered
Variable ComboTriggerVariable

Protected Types

typedef std::map< String,
InputCombo * > 
ComboMap

Protected Attributes

ActionMapInputAdapter _adapter
ComboMap _combos

Detailed Description

Acts as the base class for all input combos.

This base class defines the behaviors for an input combo. An input combo is a combination of input actions that are connected through defined rules.


Member Typedef Documentation

typedef ActionMapInputAdapter::AttributeIterator Odyssey::InputCombo::AttributeIterator
 

typedef std::map<String,InputCombo*> Odyssey::InputCombo::ComboMap [protected]
 

typedef ActionMapInputAdapter::ConstAttributeIterator Odyssey::InputCombo::ConstAttributeIterator
 


Constructor & Destructor Documentation

Odyssey::InputCombo::InputCombo  ) 
 

Constructs a new empty combo.


Member Function Documentation

void Odyssey::InputCombo::clearAttributes  ) 
 

Clears all attributes.

void Odyssey::InputCombo::clearFilters  ) 
 

Clears all filters from this combo's action map.

bool Odyssey::InputCombo::containsFilter const String name  )  const
 

Returns true of a filter with the given name exists.

Variable Odyssey::InputCombo::getAttribute const String name  )  const
 

Gets an attribute for the adapter.

size_t Odyssey::InputCombo::getAttributeCount  )  const
 

Returns the number of stored attributes.

ConstAttributeIterator Odyssey::InputCombo::getAttributeIterator  )  const
 

Returns an iterator over the stored attributes.

AttributeIterator Odyssey::InputCombo::getAttributeIterator  ) 
 

Returns an iterator over the stored attributes.

virtual void Odyssey::InputCombo::onCombo  )  [virtual]
 

This function is meant as the callback when the combo is invoked.

virtual void Odyssey::InputCombo::onEvent const String action  )  [virtual]
 

The callback for this combo's action mapping.

This is the callable target that get notified when an action from this combo's action map is invoked. It is in this overrideable that the logic for combo invocation is made. If the combo should be invoked, onCombo needs to be called.

Parameters:
action the name of the action invoked
See also:
onCombo

Reimplemented in Odyssey::TimedInputCombo, Odyssey::AndInputCombo, and Odyssey::TriggerInputCombo.

void Odyssey::InputCombo::registerAdapter InputSystem system  ) 
 

Registers this combo's action map with the input system.

void Odyssey::InputCombo::registerAdapter MultiInputAdapter adapter  ) 
 

Registers this combo's action map with the given adapter.

void Odyssey::InputCombo::removeAttribute const String name  ) 
 

Removes an attribute.

void Odyssey::InputCombo::removeFilter const String name  ) 
 

Removes the given filter from this combo's action map.

void Odyssey::InputCombo::setAttribute const String name,
const Variable attr
 

Sets an attribute for the adapter.

void Odyssey::InputCombo::setFilter const String name,
InputCombo combo
 

Add a new filter in the form of another combo.

void Odyssey::InputCombo::setFilter const String name,
InputAdapterPtr  filter
 

Add a new filter to this combo's action map.

void Odyssey::InputCombo::setFilter const String name,
InputAdapter filter,
bool  manage = true
 

Add a new filter to this combo's action map.

void Odyssey::InputCombo::unregisterAdapter InputSystem system  ) 
 

Unregisters the combo's action map from the input system.

void Odyssey::InputCombo::unregisterAdapter MultiInputAdapter adapter  ) 
 

Unregisters the combo's action map from the given adapter.


Member Data Documentation

ActionMapInputAdapter Odyssey::InputCombo::_adapter [protected]
 

ComboMap Odyssey::InputCombo::_combos [protected]
 

Delegate Odyssey::InputCombo::ComboTriggered
 

Variable Odyssey::InputCombo::ComboTriggerVariable
 


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 01:18:52 2007 for Odyssey Meta-Engine by  doxygen 1.4.6-NO