JohnCorby 4bc32dd66e aaaa
2022-05-27 19:07:05 -07:00

23 lines
548 B
C#

using QSB.EchoesOfTheEye.LightSensorSync.WorldObjects;
using QSB.Messaging;
namespace QSB.EchoesOfTheEye.LightSensorSync.Messages;
internal class LightSensorIlluminatedMessage : QSBWorldObjectMessage<QSBLightSensor, bool>
{
public LightSensorIlluminatedMessage(bool illuminated) : base(illuminated) { }
public override void OnReceiveLocal() => OnReceiveRemote();
public override void OnReceiveRemote()
{
if (Data)
{
WorldObject._illuminatedBy.SafeAdd(From);
}
else
{
WorldObject._illuminatedBy.QuickRemove(From);
}
}
}