mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
27 lines
660 B
C#
27 lines
660 B
C#
|
using QSB.EchoesOfTheEye.LightSensorSync.WorldObjects;
|
|||
|
using QSB.Messaging;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
namespace QSB.EchoesOfTheEye.LightSensorSync.Messages;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// always sent by host
|
|||
|
/// </summary>
|
|||
|
internal class IlluminatedByMessage : QSBWorldObjectMessage<QSBLightSensor, uint[]>
|
|||
|
{
|
|||
|
public IlluminatedByMessage(uint[] illuminatedBy) : base(illuminatedBy) { }
|
|||
|
|
|||
|
public override void OnReceiveRemote()
|
|||
|
{
|
|||
|
foreach (var added in Data.Except(WorldObject._illuminatedBy))
|
|||
|
{
|
|||
|
WorldObject.SetIlluminated(added, true);
|
|||
|
}
|
|||
|
|
|||
|
foreach (var removed in WorldObject._illuminatedBy.Except(Data))
|
|||
|
{
|
|||
|
WorldObject.SetIlluminated(removed, false);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|