Oprava spawnování monster, optimalizace v CommandProcessor a EventProcessor. Přesunutí některých tříd do vlastních namespaců, pročištění kódu, úpravy formátování, odstranění nepoužívaných souborů a zakomentovaného kódu

This commit is contained in:
Perry 2026-03-28 09:59:31 +01:00
parent e5d746d597
commit 243f071a43
62 changed files with 873 additions and 1217 deletions

View file

@ -4,22 +4,21 @@ using LiteNetLib.Utils;
namespace PacketLib;
public struct PlayerCommand : INetSerializable {
public static PlayerCommand SWITCH_CAM(int id) => new(){ID = 0, Args = [id] };
public static PlayerCommand SET_MONITOR(bool state) => new(){ID = 1, Args = [state ? 1 : 0]};
public static PlayerCommand SET_DOOR_OFFICE(Direction direction, bool state) => new(){ID = 2, Args = [(int)direction, state ? 1 : 0]};
public static PlayerCommand SET_DOOR_REMOTE((int, int) remoteDoorId, bool state) => new(){ID = 3, Args = [remoteDoorId.Item1, remoteDoorId.Item2, state ? 1 : 0]};
public static PlayerCommand SET_LIGHT(int camId, bool state) => new(){ID = 4, Args = [camId, state ? 1 : 0]};
public int ID{ get; set; }
public bool Hideable => ID < 0;
public static PlayerCommand SWITCH_CAM(int id) => new(){Id = 0, Args = [id] };
public static PlayerCommand SET_MONITOR(bool state) => new(){Id = 1, Args = [state ? 1 : 0]};
public static PlayerCommand SET_DOOR_OFFICE(Direction direction, bool state) => new(){Id = 2, Args = [(int)direction, state ? 1 : 0]};
public static PlayerCommand SET_DOOR_REMOTE((int, int) remoteDoorId, bool state) => new(){Id = 3, Args = [remoteDoorId.Item1, remoteDoorId.Item2, state ? 1 : 0]};
public static PlayerCommand SET_LIGHT(int camId, bool state) => new(){Id = 4, Args = [camId, state ? 1 : 0]};
public int Id{ get; set; }
public int[] Args{ get; private set; }
public void Serialize(NetDataWriter writer) {
writer.Put(ID);
writer.Put(Id);
writer.PutArray(Args);
}
public void Deserialize(NetDataReader reader) {
ID = reader.GetInt();
Id = reader.GetInt();
Args = reader.GetIntArray();
}