Hi Chris,
First of all - Thank *you* and the Islanders for creating ReplicaIsland and sharing the code with the world. And for explaining its design and function in numerous talks and posts. It is a great volume of work to study.
The port of the Java code to Kotlin was relatively straightforward. It involved a lot of "Control-Alt-Shift-K" certainly, fixing up minor confusions from the conversion process and play-testing. The last part was fun! There was one tricky bit in the ObjectManager module - the findByClass() type-casting operation needed a bit of help. My solution is shown below. And there were some unusual differences in byte processing that needed workarounds. In terms of time, I estimate that I spent about equal hours cleaning up lint complaints and play testing. The structure of the Java code was "resilient" - in other words I didn't break it too often :-).
ObjectManager.kt:
/**
* Finds a child object by its type. Note that this may invoke the class loader and therefore
* may be slow.
* @param classObject The class type to search for (e.g. BaseObject.class).
*/
fun <T> findByClass(classObject: Class<T>): T? {
val count = mObjects.count
for (i in 0 until count) {
val currentObject = mObjects[i]
if (currentObject!!.javaClass == classObject) {
return currentObject as T
}
}
return null
}