Skip to main content

AmbientTemperatureChecker

A class in Root.Township, the global namespace.

Tracks the ambient temperature for an entity from the location chunk it's in (23 unless the chunk's environment overrides it). Used by heat sources, heat points and recyclers.

Constructors​

MemberWhat it is
AmbientTemperatureChecker()Creates an AmbientTemperatureChecker from entity.
AmbientTemperatureChecker(NetworkEntity entity)Creates an AmbientTemperatureChecker from entity.

Fields​

MemberWhat it is
static readonly float standardAmbientTemperatureDefault ambient temperature (23).
1 private and internal field
MemberWhat it is
private NetworkEntity entityThe entity being watched.

Properties​

MemberWhat it is
float AmbientTemperature { get; private set; }Current ambient temperature for the entity.

Events​

MemberWhat it is
event Action OnChangedRaised when the ambient temperature changes after the entity moves chunk.

Methods​

MemberWhat it is
bool IsAmbient(float temperature)True if the given temperature is within 0.1 of ambient.
void UpdateEntity(NetworkEntity newEntity)Switches which entity is watched for chunk changes.
1 private and internal method
MemberWhat it is
private void UpdateChunk(Chunk chunk)Reads the new chunk's ambient temperature and raises OnChanged if it changed. Hooked to the entity's AddedToChunk.

Used in​

Members of other types that take, return or hold a AmbientTemperatureChecker: