Cleaned up scripts module.
This commit is contained in:
parent
b998c34c2a
commit
fea3e92573
1 changed files with 10 additions and 12 deletions
|
|
@ -132,10 +132,7 @@ class ExtendedLoopingCall(LoopingCall):
|
||||||
return self._expectNextCallAt - currentTime
|
return self._expectNextCallAt - currentTime
|
||||||
return None
|
return None
|
||||||
|
|
||||||
#
|
class ScriptBase(ScriptDB):
|
||||||
# Base script, inherit from DefaultScript below instead.
|
|
||||||
#
|
|
||||||
class _ScriptBase(ScriptDB):
|
|
||||||
"""
|
"""
|
||||||
Base class for scripts. Don't inherit from this, inherit from the
|
Base class for scripts. Don't inherit from this, inherit from the
|
||||||
class `DefaultScript` below instead.
|
class `DefaultScript` below instead.
|
||||||
|
|
@ -144,6 +141,15 @@ class _ScriptBase(ScriptDB):
|
||||||
__metaclass__ = TypeclassBase
|
__metaclass__ = TypeclassBase
|
||||||
objects = ScriptManager()
|
objects = ScriptManager()
|
||||||
|
|
||||||
|
|
||||||
|
class DefaultScript(ScriptBase):
|
||||||
|
"""
|
||||||
|
This is the base TypeClass for all Scripts. Scripts describe
|
||||||
|
events, timers and states in game, they can have a time component
|
||||||
|
or describe a state that changes under certain conditions.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
"""
|
"""
|
||||||
Compares two Scripts. Compares dbids.
|
Compares two Scripts. Compares dbids.
|
||||||
|
|
@ -385,14 +391,6 @@ class _ScriptBase(ScriptDB):
|
||||||
if task:
|
if task:
|
||||||
task.force_repeat()
|
task.force_repeat()
|
||||||
|
|
||||||
|
|
||||||
class DefaultScript(_ScriptBase):
|
|
||||||
"""
|
|
||||||
This is the base TypeClass for all Scripts. Scripts describe
|
|
||||||
events, timers and states in game, they can have a time component
|
|
||||||
or describe a state that changes under certain conditions.
|
|
||||||
|
|
||||||
"""
|
|
||||||
def at_first_save(self):
|
def at_first_save(self):
|
||||||
"""
|
"""
|
||||||
This is called after very first time this object is saved.
|
This is called after very first time this object is saved.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue