Homepage Demos Overview Downloads Tutorials Reference
Credits

BehaviorSwitchControl< B, Al > Class Template Reference

#include <BehaviorSwitchControl.h>

Inheritance diagram for BehaviorSwitchControl< B, Al >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class B, class Al = Factory< B >>
class BehaviorSwitchControl< B, Al >

Allows proper switching between major behaviors, calling DoStart and DoStop.

Definition at line 135 of file BehaviorSwitchControl.h.

Public Member Functions

 BehaviorSwitchControl (const std::string &n, bool retain=false)
 constructor, can use this to toggle a single behavior on and off
 BehaviorSwitchControl (B *beh, BehaviorGroup *bg=NULL)
 constructor, if you want to use an already constructed behavior
 BehaviorSwitchControl (const std::string &n, B *beh, BehaviorGroup *bg=NULL, bool retain=false)
 constructor, if you want to use an already constructed behavior, but unretain it if it's stopped (if not retaining, will start beh if it's not already started)
 BehaviorSwitchControl (const std::string &n, BehaviorGroup *bg, bool retain=false)
 constructor, needs to know what group its in and whether to retain its behavior
virtual ~BehaviorSwitchControl ()
 destructor
virtual std::string getName () const
 adds a status to the name: - if in memory, # if running
virtual std::string getDescription () const
 returns a short description of what the control does

Protected Member Functions

virtual void stopother ()
 Stops the "other" guy's behavior - if ::behgrp is NULL, stops ourselves.
virtual void startmine ()
 Starts our behavior.
virtual bool isValid () const
 Returns true if mybeh is pointing to a valid object.

Private Member Functions

 BehaviorSwitchControl (const BehaviorSwitchControl &)
 shouldn't call this
BehaviorSwitchControl operator= (const BehaviorSwitchControl &)
 shouldn't call this

Private Attributes

bool retained
 true if the behavior should be generated once and retained after DoStop. Otherwise, a new one is generated each time it is started


Constructor & Destructor Documentation

template<class B, class Al = Factory< B >>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl const std::string &  n,
bool  retain = false
[inline]
 

constructor, can use this to toggle a single behavior on and off

Definition at line 138 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl B *  beh,
BehaviorGroup *  bg = NULL
[inline]
 

constructor, if you want to use an already constructed behavior

Definition at line 142 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl const std::string &  n,
B *  beh,
BehaviorGroup *  bg = NULL,
bool  retain = false
[inline]
 

constructor, if you want to use an already constructed behavior, but unretain it if it's stopped (if not retaining, will start beh if it's not already started)

Definition at line 146 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl const std::string &  n,
BehaviorGroup *  bg,
bool  retain = false
[inline]
 

constructor, needs to know what group its in and whether to retain its behavior

Definition at line 174 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
virtual BehaviorSwitchControl< B, Al >::~BehaviorSwitchControl  )  [inline, virtual]
 

destructor

Definition at line 179 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl const BehaviorSwitchControl< B, Al > &   )  [private]
 

shouldn't call this


Member Function Documentation

template<class B, class Al = Factory< B >>
virtual std::string BehaviorSwitchControl< B, Al >::getDescription  )  const [inline, virtual]
 

returns a short description of what the control does

Reimplemented from BehaviorSwitchControlBase.

Definition at line 196 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
virtual std::string BehaviorSwitchControl< B, Al >::getName  )  const [inline, virtual]
 

adds a status to the name: - if in memory, # if running

Reimplemented from BehaviorSwitchControlBase.

Definition at line 190 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
virtual bool BehaviorSwitchControl< B, Al >::isValid  )  const [inline, protected, virtual]
 

Returns true if mybeh is pointing to a valid object.

Definition at line 249 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::getDescription(), and BehaviorSwitchControl< B, Al >::getName().

template<class B, class Al = Factory< B >>
BehaviorSwitchControl BehaviorSwitchControl< B, Al >::operator= const BehaviorSwitchControl< B, Al > &   )  [private]
 

shouldn't call this

template<class B, class Al = Factory< B >>
virtual void BehaviorSwitchControl< B, Al >::startmine  )  [inline, protected, virtual]
 

Starts our behavior.

Reimplemented from BehaviorSwitchControlBase.

Definition at line 224 of file BehaviorSwitchControl.h.

template<class B, class Al = Factory< B >>
virtual void BehaviorSwitchControl< B, Al >::stopother  )  [inline, protected, virtual]
 

Stops the "other" guy's behavior - if ::behgrp is NULL, stops ourselves.

Reimplemented from BehaviorSwitchControlBase.

Definition at line 206 of file BehaviorSwitchControl.h.


Member Data Documentation

template<class B, class Al = Factory< B >>
bool BehaviorSwitchControl< B, Al >::retained [private]
 

true if the behavior should be generated once and retained after DoStop. Otherwise, a new one is generated each time it is started

Definition at line 256 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::BehaviorSwitchControl(), and BehaviorSwitchControl< B, Al >::stopother().


The documentation for this class was generated from the following file:

Tekkotsu v2.2
Generated Tue Oct 19 14:20:15 2004 by Doxygen 1.3.9.1