Skip to content

Commit

Permalink
feat: geo.terrain_height_for_pos(position) added for fluency
Browse files Browse the repository at this point in the history
  • Loading branch information
dysonreturns committed Mar 26, 2024
1 parent e56f6b5 commit 83ab48b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/sc2ai/player/geometry.rb
Expand Up @@ -259,6 +259,12 @@ def terrain_height(x:, y:)
parsed_terrain_height[y.to_i, x.to_i]
end

# Returns the terrain height (z) at position x and y for a point
# @return [Float] z axis position between -16 and 16
def terrain_height_for_pos(position)
terrain_height(x: position.x, y: position.y)
end

# Returns a parsed terrain_height from bot.game_info.start_raw.
# Each value in [row][column] holds a float value which is the z height
# @return [Numo::SFloat] Numo array
Expand Down

0 comments on commit 83ab48b

Please sign in to comment.