nuked fluidcodex

This commit is contained in:
minjaesong
2019-01-27 05:09:52 +09:00
parent 50d883260c
commit 89ecdbc608
6 changed files with 72 additions and 32 deletions

View File

@@ -1,29 +1,7 @@
package net.torvald.terrarum.gameworld
import net.torvald.terrarum.blockproperties.Fluid
/**
* Created by minjaesong on 2016-08-06.
*/
object FluidCodex {
operator fun get(type: FluidType): FluidProp {
return if (type sameAs Fluid.NULL)
nullProp
else
waterProp
}
// TODO temporary, should read from CSV
val nullProp = FluidProp.getNullProp()
val waterProp = FluidProp()
init {
waterProp.shadeColR = 0.1016f
waterProp.shadeColG = 0.0744f
waterProp.shadeColB = 0.0508f
waterProp.shadeColA = 0.0508f
waterProp.density = 1000
}
}
// Use BlockCodex. --Torvald, 2019-01-27

View File

@@ -1,14 +1,9 @@
package net.torvald.terrarum.gameworld
import com.badlogic.gdx.graphics.Color
import net.torvald.terrarum.blockproperties.Block
import net.torvald.terrarum.blockproperties.BlockCodex
import net.torvald.terrarum.blockproperties.BlockPropUtil
/**
* Created by minjaesong on 2018-12-29.
*/
class FluidProp {
/*class FluidProp {
var density: Int = 0
@@ -45,4 +40,4 @@ class FluidProp {
return p
}
}
}
}*/

View File

@@ -412,7 +412,7 @@ open class GameWorld {
data class FluidInfo(val type: FluidType, val amount: Float) {
/** test if this fluid should be considered as one */
fun isFluid() = type != Fluid.NULL && amount >= WorldSimulator.FLUID_MIN_MASS
fun getProp() = FluidCodex[type]
fun getProp() = BlockCodex[type]
override fun toString() = "Fluid type: ${type.value}, amount: $amount"
}