Cleaned up scripts module.

This commit is contained in:
Griatch 2015-03-09 18:13:25 +01:00
parent b998c34c2a
commit fea3e92573

View file

@ -132,10 +132,7 @@ class ExtendedLoopingCall(LoopingCall):
return self._expectNextCallAt - currentTime
return None
#
# Base script, inherit from DefaultScript below instead.
#
class _ScriptBase(ScriptDB):
class ScriptBase(ScriptDB):
"""
Base class for scripts. Don't inherit from this, inherit from the
class `DefaultScript` below instead.
@ -144,6 +141,15 @@ class _ScriptBase(ScriptDB):
__metaclass__ = TypeclassBase
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):
"""
Compares two Scripts. Compares dbids.
@ -385,14 +391,6 @@ class _ScriptBase(ScriptDB):
if task:
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):
"""
This is called after very first time this object is saved.