mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 21:32:47 +00:00
23 lines
548 B
C#
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);
|
|
}
|
|
}
|
|
}
|