Resolving issues #16 and #20

This commit is contained in:
Song Minjae
2017-04-24 02:23:13 +09:00
parent 6399c2d66b
commit 5cd5ebbea3
21 changed files with 158 additions and 76 deletions

View File

@@ -0,0 +1,29 @@
package net.torvald.terrarum.gameworld
import net.torvald.terrarum.gameactors.ActorID
/**
* This world is economically isolated system. Economy will be important to make player keep playing,
* when all the necessary contents are set and implemented to the production.
*
* Created by SKYHi14 on 2017-04-23.
*/
class GameEconomy {
val transactionHistory = TransanctionHistory()
}
class TransanctionHistory {
private val entries = ArrayList<TransanctionHistory>()
/**
* @param to set 0 to indicate the money was lost to void
*/
data class TransactionEntry(val from: ActorID, val to: ActorID, val amount: Long) {
override fun toString() = "$from -> $to; $amount"
}
}

View File

@@ -34,10 +34,18 @@ class GameWorld(val width: Int, val height: Int) {
var gravitation: Vector2 = Vector2(0.0, 9.8)
/** RGB in Integer */
var globalLight: Int = 0
val time: WorldTime
val economy = GameEconomy()
var generatorSeed: Long = 0
init {
this.spawnX = width / 2
this.spawnY = 200