always sorting arraylist; more wire stuffs

This commit is contained in:
minjaesong
2019-03-12 19:50:28 +09:00
parent 0563ef0940
commit 08aa0e8f34
30 changed files with 288 additions and 115 deletions

View File

@@ -11,7 +11,7 @@ import net.torvald.terrarum.gameworld.fmod
*/
object LandUtil {
fun getBlockAddr(world: GameWorld, x: Int, y: Int): BlockAddress =
// coercing and fmod-ing follows ROUNDWORLD rule
// coercing and fmod-ing follows ROUNDWORLD rule. See: GameWorld.coerceXY()
(world.width * y.coerceIn(0, world.height - 1)).toLong() + x.fmod(world.width)
fun resolveBlockAddr(world: GameWorld, t: BlockAddress): Pair<Int, Int> =