forked from jacnel/LilyInteractive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivity.py
More file actions
18 lines (16 loc) · 682 Bytes
/
activity.py
File metadata and controls
18 lines (16 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""This class acts as a wrapper for activity functions that serve as the
interaction between user and story. By passing both the function reference
and the necessary parameters, it allows the story to dynamically call the
correct activity when necessary."""
from player import Player
class Activity(object):
def __init__(self, func, *args):
self.func = func
self.args = args
def doActivity(self, player):
#node is set to completed BEFORE the activity is executed
player.completed[player.location.name] = True
if len(self.args) == 0:
return self.func(player)
else:
return self.func(player, self.args)