mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 21:14:04 +09:00
nuked fluidcodex
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user