Aetheria/Assets/Scripts/ServerShared/Behaviors/Thermotoggle.cs

31 lines
1,012 B
C#
Raw Normal View History

2026-06-13 04:56:50 +01:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
public class Thermotoggle : Behavior
{
public float TargetTemperature;
public bool Adjustable { get; }
private readonly bool _highPass;
2026-06-15 19:20:06 +01:00
public Thermotoggle(RuntimeBehaviorDefinition definition, EquippedItem item) : base(definition, item)
{
2026-06-15 19:20:06 +01:00
TargetTemperature = definition.Float(1);
_highPass = definition.Bool(2);
Adjustable = definition.Bool(3);
}
2026-06-15 19:20:06 +01:00
public Thermotoggle(RuntimeBehaviorDefinition definition, ConsumableItemEffect item) : base(definition, item)
{
2026-06-15 19:20:06 +01:00
TargetTemperature = definition.Float(1);
_highPass = definition.Bool(2);
Adjustable = definition.Bool(3);
}
public override bool Execute(float dt)
{
return Temperature < TargetTemperature ^ _highPass;
}
}