Pascal Serrarens 9b44918eaf Client->Participant
Custom msg is working now
2024-12-16 12:48:59 +01:00

41 lines
1.0 KiB
C#

using System.Collections.Generic;
namespace Passer.Control
{
public class CoreThing
{
public Participant participant;
public byte networkId;
public byte id;
public CoreThing parent;
public byte type;
public string name;
public string modelUrl;
//protected Sensor sensor;
protected virtual void Init()
{
}
public CoreThing(Participant client, byte networkId, byte thingId, byte thingType = 0)
{
this.participant = client;
this.id = thingId;
this.type = thingType;
this.networkId = networkId;
this.Init();
allThings.Add(this);
}
private static readonly List<CoreThing> allThings = new();
public static CoreThing Get(byte networkId, byte thingId)
{
CoreThing thing = allThings.Find(aThing => aThing.networkId == networkId && aThing.id == thingId);
return thing;
}
}
}