Closer to actually editing
All checks were successful
Build Dusk / build-linux (push) Successful in 50s
Build Dusk / build-psp (push) Successful in 59s

This commit is contained in:
2025-11-16 10:40:20 -06:00
parent 7c194ab4b4
commit cf59989167
10 changed files with 306 additions and 120 deletions

View File

@@ -0,0 +1,37 @@
class Map:
def __init__(self):
self._position = [0, 0, 0] # x, y, z
self.listeners = []
self.chunks = []
self.width = 5
self.height = 5
self.depth = 3
@property
def position(self):
return self._position
@position.setter
def position(self, value):
self._position = value
self.notifyPositionListeners()
def addPositionListener(self, listener):
self.listeners.append(listener)
def notifyPositionListeners(self):
for listener in self.listeners:
listener(self._position)
def moveTo(self, x, y, z):
self.position = [x, y, z]
def moveRelative(self, x, y, z):
self.moveTo(
self._position[0] + x,
self._position[1] + y,
self._position[2] + z
)
# Singleton instance
map = Map()