-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestInstance.py
More file actions
35 lines (22 loc) · 779 Bytes
/
QuestInstance.py
File metadata and controls
35 lines (22 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from datetime import datetime
from Shops.GeneralStore import GeneralStore
from Characters.Human import Human
from Cities.NewbieWorld import NewbieWorld
from Utilities import *
class QuestInstance():
def __init__(self, quest):
self.room_id = _generate_unique_id()
self.quest_characters = list()
self.quest = quest
self.date_started = datetime.utcnow()
def add_character(self, character):
self.quest_characters.append(character)
return True
def list_quest_characters(self, json=False):
char_list = list()
for char in self.quest_characters:
if json:
char_list.append(char.to_JSON())
else:
char_list.append(char)
return char_list