mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
weather in weathercodex
This commit is contained in:
@@ -9,7 +9,7 @@ import net.torvald.terrarum.gameworld.fmod
|
||||
/**
|
||||
* Created by minjaesong on 2016-02-16.
|
||||
*/
|
||||
class BlockProp {
|
||||
class BlockProp : TaggedProp {
|
||||
|
||||
var id: ItemID = ""
|
||||
var numericID: Int = -1
|
||||
@@ -75,16 +75,7 @@ class BlockProp {
|
||||
BlockCodex[BlockCodex.tileToVirtual[id]!![offset]]._lumCol.lane(channel)
|
||||
}
|
||||
|
||||
fun hasTag(s: String) = tags.contains(s)
|
||||
fun hasAnyTagOf(vararg s: String) = s.any { hasTag(it) }
|
||||
fun hasAnyTag(s: Collection<String>) = s.any { hasTag(it) }
|
||||
fun hasAnyTag(s: Array<String>) = s.any { hasTag(it) }
|
||||
fun hasAllTagOf(vararg s: String) = s.all { hasTag(it) }
|
||||
fun hasAllTag(s: Collection<String>) = s.all { hasTag(it) }
|
||||
fun hasAllTag(s: Array<String>) = s.all { hasTag(it) }
|
||||
fun hasNoTagOf(vararg s: String) = s.none { hasTag(it) }
|
||||
fun hasNoTag(s: Collection<String>) = s.none { hasTag(it) }
|
||||
fun hasNoTag(s: Array<String>) = s.none { hasTag(it) }
|
||||
override fun hasTag(s: String) = tags.contains(s)
|
||||
|
||||
/**
|
||||
* @param luminosity
|
||||
|
||||
@@ -108,7 +108,7 @@ object BlockPropUtil {
|
||||
return when (prop.dynamicLuminosityFunction) {
|
||||
1 -> getTorchFlicker(prop)
|
||||
2 -> (INGAME.world).globalLight.cpy() // current global light
|
||||
3 -> WeatherMixer.getGlobalLightOfTimeOfNoon(WeatherMixer.weatherDict["generic01"]!!).cpy() // daylight at noon
|
||||
3 -> WeatherMixer.getGlobalLightOfTimeOfNoon(WeatherCodex.getById("generic01")!!).cpy() // daylight at noon
|
||||
4 -> getSlowBreath(prop)
|
||||
5 -> getPulsate(prop)
|
||||
else -> prop.baseLumCol
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.blockproperties
|
||||
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.TaggedProp
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
import net.torvald.terrarum.utils.CSVFetcher
|
||||
import org.apache.commons.csv.CSVRecord
|
||||
@@ -78,11 +79,11 @@ class OreCodex {
|
||||
}
|
||||
|
||||
|
||||
class OreProp {
|
||||
class OreProp : TaggedProp {
|
||||
var id: String = ""
|
||||
var item: ItemID = ""
|
||||
var tags = HashSet<String>()
|
||||
|
||||
fun hasTag(s: String) = tags.contains(s)
|
||||
override fun hasTag(s: String) = tags.contains(s)
|
||||
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
package net.torvald.terrarum.blockproperties
|
||||
|
||||
import net.torvald.terrarum.Codex
|
||||
import net.torvald.terrarum.TaggedProp
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2021-07-28.
|
||||
*/
|
||||
class WireProp {
|
||||
class WireProp : TaggedProp {
|
||||
|
||||
var id: ItemID = ""
|
||||
var numericID: Int = -1
|
||||
@@ -27,15 +28,5 @@ class WireProp {
|
||||
|
||||
@Transient var tags = HashSet<String>()
|
||||
|
||||
fun hasTag(s: String) = tags.contains(s)
|
||||
fun hasAnyTagOf(vararg s: String) = s.any { hasTag(it) }
|
||||
fun hasAnyTag(s: Collection<String>) = s.any { hasTag(it) }
|
||||
fun hasAnyTag(s: Array<String>) = s.any { hasTag(it) }
|
||||
fun hasAllTagOf(vararg s: String) = s.all { hasTag(it) }
|
||||
fun hasAllTag(s: Collection<String>) = s.all { hasTag(it) }
|
||||
fun hasAllTag(s: Array<String>) = s.all { hasTag(it) }
|
||||
fun hasNoTagOf(vararg s: String) = s.none { hasTag(it) }
|
||||
fun hasNoTag(s: Collection<String>) = s.none { hasTag(it) }
|
||||
fun hasNoTag(s: Array<String>) = s.none { hasTag(it) }
|
||||
|
||||
override fun hasTag(s: String) = tags.contains(s)
|
||||
}
|
||||
Reference in New Issue
Block a user