- A
Thing with simple On-Off behavior
- Also the base class for garments, boxes, and other
things which have a basic two-state behavior.
'Use'=Activate .
Activate = turn the switch on
Deactivate = turn the switch off
No toggle method -- a "toggle" verb does this.
- class Switch
- has Activate and Deactivate (and supporting) methods
Methods
|
|
Activate
Deactivate
PostObj
PreObj
Use
__init__
|
|
Activate
|
Activate ( self, pUser=None )
Turn the Switch On .
define some new methods
|
|
Deactivate
|
Deactivate ( self, pUser=None )
Turn the Switch Off .
|
|
PostObj
|
PostObj ( self, cmd )
PostObj: perform action, give the appropriate output
|
|
PreObj
|
PreObj ( self, cmd )
see whether the thing can be activated/deactivated
|
|
Use
|
Use ( self, pUser )
Same as Activate .
|
|
__init__
|
__init__ ( self, pNames='' )
|
|