mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-21 07:54:05 +09:00
moved Codices out of the singleton so they can be serialised
This commit is contained in:
@@ -5,6 +5,7 @@ import net.torvald.terrarum.gameactors.faction.FactionCodex
|
||||
import net.torvald.terrarum.gameworld.BlockAddress
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarum.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-03-27.
|
||||
|
||||
@@ -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