Interface TemperatureAware
- All Known Implementing Classes:
EnvironmentAwareEntityMixin
public interface TemperatureAware
TemperatureAware entities are things that are sensitive to temperature. In Thermoo, the Temperature of a Thermally-aware
object is an arbitrary unit that represents the total heat (or cold) they have collected. It is not based on standard
units of temperature like Celsius, Kelvin, or Fahrenheit. Positive values of temperature are treated as 'warm' and
negative values are treated as 'cold'.
This class is interface injected into LivingEntity. Therefore, ALL methods must have a
default implementation. Methods that should normally be abstract should throw a NotImplementedException instead
of being declared abstract.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidthermoo$addTemperature(int temperatureChange) Adds or removes some amount of temperature to the thermally aware object.default voidthermoo$addTemperature(int temperatureChange, HeatingMode mode) Adds or removes some amount of temperature to the thermally aware object.default booleandefault booleandefault doubleSupplies the cold resistance of the temperature aware object.default doubleSupplies the heat resistance of the temperature aware object.default intdefault intdefault intdefault floatdefault booleandefault booleandefault voidthermoo$setTemperature(int temperature)
-
Method Details
-
thermoo$getTemperature
default int thermoo$getTemperature()- Returns:
- Returns the current temperature of the temperature aware object
-
thermoo$setTemperature
default void thermoo$setTemperature(int temperature) - Parameters:
temperature- Sets the current temperature of the temperature aware object to an exact value
-
thermoo$getMinTemperature
default int thermoo$getMinTemperature()- Returns:
- Returns the minimum allowed temperature of the temperature aware object.
-
thermoo$getMaxTemperature
default int thermoo$getMaxTemperature()- Returns:
- Returns the maximum allowed temperature of the temperature aware object
-
thermoo$getColdResistance
default double thermoo$getColdResistance()Supplies the cold resistance of the temperature aware object. Cold Resistance is a percentage on a scale from 0 to 10, where 0 cold resistance corresponds to 0%, and 10 cold resistance corresponds to 100%.- Returns:
- Returns the cold resistance of the temperature aware object
-
thermoo$getHeatResistance
default double thermoo$getHeatResistance()Supplies the heat resistance of the temperature aware object. Heat Resistance is a percentage on a scale from 0 to 10, where 0 heat resistance corresponds to 0%, and 10 heat resistance corresponds to 100%.- Returns:
- Returns the heat resistance of the temperature aware object
-
thermoo$canFreeze
default boolean thermoo$canFreeze()- Returns:
- Returns if the thermally aware object can be affected by cold
-
thermoo$canOverheat
default boolean thermoo$canOverheat()- Returns:
- Returns if the thermally aware object can be affected by heat
-
thermoo$isCold
default boolean thermoo$isCold() -
thermoo$isWarm
default boolean thermoo$isWarm() -
thermoo$addTemperature
Adds or removes some amount of temperature to the thermally aware object. Resistance can be applied by specifying aHeatingMode. SeeHeatingModesfor some common modes.- Parameters:
temperatureChange- The amount of temperature to add/remove. Positive change adds, negative change removes.mode- The mode of resistance to apply to the change.
-
thermoo$addTemperature
default void thermoo$addTemperature(int temperatureChange) Adds or removes some amount of temperature to the thermally aware object. Applies no resistance.- Parameters:
temperatureChange- The amount of temperature to add/remove. Positive change adds, negative change removes.
-
thermoo$getTemperatureScale
default float thermoo$getTemperatureScale()- Returns:
- Returns the current temperature as a -1 to +1 percentage scale of the minimum/maximum temperature.
-