mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 18:14:06 +09:00
why things are keep happening?
This commit is contained in:
@@ -42,14 +42,18 @@ object BlockCodex {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun get(index: Int): BlockProp {
|
/*fun get(index: Int): BlockProp {
|
||||||
try {
|
try {
|
||||||
return blockProps[index]
|
return blockProps[index]
|
||||||
}
|
}
|
||||||
catch (e: NullPointerException) {
|
catch (e: NullPointerException) {
|
||||||
throw NullPointerException("Blockprop with id $index does not exist.")
|
throw NullPointerException("Blockprop with id $index does not exist.")
|
||||||
}
|
}
|
||||||
}
|
catch (e1: ArrayIndexOutOfBoundsException) {
|
||||||
|
if (index == -1) return nullProp
|
||||||
|
else throw e1
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
operator fun get(rawIndex: Int?): BlockProp {
|
operator fun get(rawIndex: Int?): BlockProp {
|
||||||
if (rawIndex == null || rawIndex == Block.NULL) {
|
if (rawIndex == null || rawIndex == Block.NULL) {
|
||||||
|
|||||||
@@ -40,5 +40,8 @@ class PhysTestBall : ActorWithPhysics(Actor.RenderOrder.MIDDLE, immobileBody = t
|
|||||||
hitbox.posY.toFloat(),
|
hitbox.posY.toFloat(),
|
||||||
hitbox.width.toFloat(),
|
hitbox.width.toFloat(),
|
||||||
hitbox.height.toFloat())
|
hitbox.height.toFloat())
|
||||||
|
|
||||||
|
|
||||||
|
//println(moveDelta)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,14 +64,14 @@ object ROTCipher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note; range starts with zero
|
* Note; domain starts from zero
|
||||||
* @param number to rotate
|
* @param number to rotate
|
||||||
* @param rotation
|
* @param rotation
|
||||||
* @param range size of the rotation table. 4 means (0,1,2,3)
|
* @param domain size of the rotation table (or domain of the function). 4 means (0,1,2,3)
|
||||||
*/
|
*/
|
||||||
fun rotN(number: Int, rotation: Int, range: Int): Int {
|
private fun rotN(number: Int, rotation: Int, domain: Int): Int {
|
||||||
return if (number < range - rotation + 1) number + rotation
|
return if (number < domain - rotation + 1) number + rotation
|
||||||
else number - (range - rotation + 1)
|
else number - (domain - rotation + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun rot13(c: Char): Char {
|
fun rot13(c: Char): Char {
|
||||||
|
|||||||
Reference in New Issue
Block a user