Package scripts :: Script quest_engine :: Class QuestEngine
[hide private]
[frames] | no frames]

Class QuestEngine

source code

object --+    
         |    
      dict --+
             |
            QuestEngine

Instance Methods [hide private]
new empty dictionary

__init__(self, quest_dir)
Create a quest engine object
source code
 
__str__(self)
str(x)
source code
 
__getitem__(self, key)
x[y]
source code
list of D's (key, value) pairs, as 2-tuples
items(self) source code
list of D's values
values(self) source code
list of D's keys
keys(self) source code
 
readQuests(self)
Reads in the quests in the quest directory
source code
 
activateQuest(self, quest_id)
Add a quest to the quest log
source code
 
finishQuest(self, quest_id)
Move a quest to the finished quests log
source code
 
restartQuest(self, quest_id)
Restart a quest
source code
 
failQuest(self, quest_id)
Set a quest to failed
source code
 
hasQuest(self, quest_id)
Check whether a quest is present in the quest_list.
source code
 
hasActiveQuest(self, quest_id)
Check whether a quest is in the quest log
source code
 
hasFinishedQuest(self, quest_id)
Check whether a quest is in the finished quests log
source code
 
hasFailedQuest(self, quest_id)
Check whether a quest is in the failed quests log
source code
 
getStateForSaving(self)
Prepares state for saving
source code
 
restoreFromState(self, state)
Restores the state
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, iteritems, iterkeys, itervalues, pop, popitem, setdefault, update

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, quest_dir)
(Constructor)

source code 

Create a quest engine object

Returns:
new empty dictionary

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__getitem__(self, key)
(Indexing operator)

source code 

x[y]

Overrides: dict.__getitem__
(inherited documentation)

items(self)

source code 
Returns: list of D's (key, value) pairs, as 2-tuples
Overrides: dict.items
(inherited documentation)

values(self)

source code 
Returns: list of D's values
Overrides: dict.values
(inherited documentation)

keys(self)

source code 
Returns: list of D's keys
Overrides: dict.keys
(inherited documentation)

activateQuest(self, quest_id)

source code 

Add a quest to the quest log

Parameters:
  • quest - the quest id of the quest to add to the quest log
Returns:
True if succesfully added

finishQuest(self, quest_id)

source code 

Move a quest to the finished quests log

Parameters:
  • quest_id - The id of the quest you want to move
Returns:
True on success

restartQuest(self, quest_id)

source code 

Restart a quest

Parameters:
  • quest_id - ID of the quest you want to restart
Returns:
True on success

failQuest(self, quest_id)

source code 

Set a quest to failed

Parameters:
  • quest_id - ID of the quest you want to fail
Returns:
True on success

hasQuest(self, quest_id)

source code 

Check whether a quest is present in the quest_list. It doesn't matter which state the quest is, or even if its started.

Parameters:
  • quest_id - ID of the quest you want to check
Returns:
True on when the quest is in the quest log

hasActiveQuest(self, quest_id)

source code 

Check whether a quest is in the quest log

Parameters:
  • quest_id - ID of the quest you want to check
Returns:
True on when the quest is in the quest log

hasFinishedQuest(self, quest_id)

source code 

Check whether a quest is in the finished quests log

Parameters:
  • quest_id - ID of the quest you want to check
Returns:
True on when the quest is in the finished quests log

hasFailedQuest(self, quest_id)

source code 

Check whether a quest is in the failed quests log

Parameters:
  • quest_id - ID of the quest you want to check
Returns:
True on when the quest is in the failed quests log

getStateForSaving(self)

source code 

Prepares state for saving

Parameters:
  • state (dictionary) - State of the object