Spaces:
Running
Running
intended block
Browse files- helper_functions.py +12 -12
helper_functions.py
CHANGED
@@ -125,15 +125,15 @@ def process_ending(idea_is_accepted, game_number, idea):
|
|
125 |
world_graph = WorldGraph(f'games/game_{game_number}/world_graph.edgelist')
|
126 |
|
127 |
with open(f'games/game_{game_number}/round_consequences.json', 'r',encoding='utf-8') as f:
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
125 |
world_graph = WorldGraph(f'games/game_{game_number}/world_graph.edgelist')
|
126 |
|
127 |
with open(f'games/game_{game_number}/round_consequences.json', 'r',encoding='utf-8') as f:
|
128 |
+
consequences = json.load(f)
|
129 |
+
country = consequences['country']
|
130 |
+
if idea_is_accepted:
|
131 |
+
delta_USA = int(consequences['delta_USA'])
|
132 |
+
delta_country = int(consequences['delta_country'])
|
133 |
+
delta_friendliness = int(consequences['delta_friendliness'])
|
134 |
+
if not idea_is_accepted:
|
135 |
+
delta_USA = 0
|
136 |
+
delta_country = 0
|
137 |
+
delta_friendliness = -int(consequences['delta_friendliness'])
|
138 |
+
|
139 |
+
world_graph.update_world(country, delta_USA, delta_country, delta_friendliness, game_number)
|