Skip to content

Commit

Permalink
Fix bug in map size
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmdrz-mirdamadi committed Sep 5, 2022
1 parent a9355c0 commit 70a1ee6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions maps/map1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"width":9,
"height":11,
"width":11,
"height":9,
"player1_coordinate":[0,0],
"player2_coordinate":[0,8],
"player3_coordinate":[0,2],
Expand Down
8 changes: 4 additions & 4 deletions src/environment/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def __init__(self,
'wallet': 0
}]
self.input_map = input_map
self.x_size = input_map['width']
self.y_size = input_map['height']
self.x_size = input_map['height']
self.y_size = input_map['width']
self.agents_cnt = agents_cnt
self.rounds = rounds
self.max_rounds = rounds
Expand Down Expand Up @@ -369,8 +369,8 @@ def generate_info(self):

def load_map(self):
conf_dic = self.input_map
self.x_size = conf_dic["width"]
self.y_size = conf_dic["height"]
self.x_size = conf_dic["height"]
self.y_size = conf_dic["width"]
self.fog_map = conf_dic["fog_map"]
for i in range(self.agents_cnt):
self.agents_list[i].x = conf_dic[f"player{i+1}_coordinate"][0]
Expand Down
4 changes: 2 additions & 2 deletions src/process/GameHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def final_update_info(self):
igd['winner'] = self.players[self.winner[0] - 1]['name']
igd['winnerId'] = self.winner[0]
igd['win_reason'] = self.winner[1]
igd['map_width'] = int(self.info[0]['board'].shape[0])
igd['map_height'] = int(self.info[0]['board'].shape[1])
igd['map_width'] = self.map['width']
igd['map_height'] = self.map['height']
igd['map_data'] = {}
igd['map_data']['obstacle'] = self.map['walls']
igd['map_data']['fog'] = self.map['fog_map']
Expand Down

0 comments on commit 70a1ee6

Please sign in to comment.