Dungeon-CampusMinden / Dungeon

The "Dungeon" is a tool to gamify classroom content and integrate it into a 2D Rogue-Like role-playing game.
MIT License
15 stars 33 forks source link

Core: Refactoring of core.level.Tile, core.utils.Point and core.level.utils.LevelUtils #1543

Open cagix opened 3 weeks ago

cagix commented 3 weeks ago

aus #1542: es sollte definitiv Tile#toPoint() geben. und wenn man dann noch in Point#shift implementiert, dann könnte man in LevelUtils#isAnyCornerOfTileInRadius aus

Point.inRange(center, new Point(tile.coordinate().toPoint().x, tile.coordinate().toPoint().y + 1))

ein einfaches

Point.inRange(center, tile.toPoint().shift(0, 1))

machen.

cagix commented 3 weeks ago

ok, Tile hat bereits wahlweise den zugriff per Tile#coordinate bzw. Tile#position.

wir brauchen nur noch ein shift für Point, und natürlich die anpassung in LevelUtils.