working more

This commit is contained in:
2025-10-02 15:31:30 -06:00
parent 72bd5fb9c0
commit ed3cd08130
6 changed files with 67 additions and 47 deletions
+20
View File
@@ -0,0 +1,20 @@
# Nathan Hinton 1 Oct 2025
# Create a custom hash class for the universe.
require './position'
# This will contain the universe hash inside it. It will allow for array type
# indexing as well as point type indexing
class UniverseArray < Array
def initialize
super
end
def [](index, *rest)
if index.is_a?(Position)
return self[position.y_pos][position.x_pos]
else
super
end
end
end