Added water filtration and added location positions (#32)

This commit is contained in:
David St-Louis
2021-07-25 09:33:47 -04:00
committed by GitHub
parent 153fa16bcf
commit 85481d7321
3 changed files with 136 additions and 138 deletions

View File

@@ -198,12 +198,9 @@ def get_max_depth(state, player):
def can_access_location(state, player, loc):
# Extract location from game id.
# Game id is in format: "(x, y, z)"
pos_raw = loc.get("game_id")[1:-1].split(', ')
pos_x = float(pos_raw[0])
pos_y = float(pos_raw[1])
pos_z = float(pos_raw[2])
pos_x = loc.get("position").get("x")
pos_y = loc.get("position").get("y")
pos_z = loc.get("position").get("z")
depth = -pos_y # y-up
map_center_dist = math.sqrt(pos_x**2 + pos_z**2)
aurora_dist = math.sqrt((pos_x - 1040)**2 + (pos_z - -160)**2)