mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-22 00:14:05 +09:00
moved Codices out of the singleton so they can be serialised
This commit is contained in:
@@ -6,13 +6,17 @@ import java.util.*
|
||||
/**
|
||||
* Created by minjaesong on 2016-03-27.
|
||||
*/
|
||||
object RealEstateCodex {
|
||||
class RealEstateCodex {
|
||||
/**
|
||||
* HashMap<Absolute block number, Actor/Faction ID>
|
||||
*
|
||||
* Note that a block can have only ONE owner (as an Actor or Faction ID)
|
||||
*/
|
||||
private var ownershipRegistry: HashMap<Long, Int> = HashMap()
|
||||
private val ownershipRegistry: HashMap<Long, Int> = HashMap()
|
||||
|
||||
fun clear() = ownershipRegistry.clear()
|
||||
|
||||
internal constructor()
|
||||
|
||||
fun setOwner(world: GameWorld, tileX: Int, tileY: Int, refID: Int) {
|
||||
ownershipRegistry[LandUtil.getBlockAddr(world, tileX, tileY)] = refID
|
||||
|
||||
Reference in New Issue
Block a user