guibec / rpgcraft

RPGCraft - Minecraft / Terraria / RPGMaker mashup
MIT License
8 stars 2 forks source link

Tech Debt: Create Universal coordinate class/structure #62

Open robinlavallee opened 5 years ago

robinlavallee commented 5 years ago

The code is getting confusing using Vector2, int that means different things:

The origin is different, chunk goes from 0 to 63, but 32 is the center. World coordinate is 0 for the center.

Simplify this by creating a UniversalCoordinate object (name TBD) that expose multiple properties with internal conversion. Change all methods to use UniversalCoordinate (whenever it makes sense).