mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
29
src/net/torvald/terrarum/gameworld/GameEconomy.kt
Normal file
29
src/net/torvald/terrarum/gameworld/GameEconomy.kt
Normal 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"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user