mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-11-04 08:23:57 +00:00
Added .idea to gitignore, first pass at adding intregrated pathfindiing support using redblobgames.com tutorials as reference
This commit is contained in:
15
lib/cyberarm_engine/pathfinding/graph.rb
Normal file
15
lib/cyberarm_engine/pathfinding/graph.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module CyberarmEngine
|
||||
module Pathfinding
|
||||
class Graph
|
||||
Location = Data.define(:x, :y, :z, :cost)
|
||||
|
||||
def initialize(edges: {})
|
||||
@edges = edges
|
||||
end
|
||||
|
||||
def neighbors(location)
|
||||
@edges[location]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user