diff options
| author | Sarah B <git@sarahduck.ca> | 2023-12-24 21:04:19 -0800 |
|---|---|---|
| committer | Sarah B <git@sarahduck.ca> | 2023-12-24 21:04:19 -0800 |
| commit | 0206e04e0a3542b8f0fc97996f1d885f7604a6fa (patch) | |
| tree | 575f1388978b110064993445b73dcf268218a750 /Net.cs | |
| parent | c4dd5d6fe58a21f9cab5ce271cd3554c2fe791e3 (diff) | |
network mouse click, restructure oneko, add framework for NPCState stuff
Diffstat (limited to 'Net.cs')
| -rw-r--r-- | Net.cs | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -50,29 +50,23 @@ public static class NetExtensions public enum PacketType : byte { - MousePosition, - OnekoTargetPosition, + MouseState, + OnekoState, UserInfo, UserId, Disconnect, Invalid } -public struct PacketInfo +public struct PacketInfo(PacketType type, int id) { - public readonly PacketType Type; - public readonly int FromId; + public readonly PacketType Type = type; + public readonly int FromId = id; public const int SizeOf = sizeof(int) + 1; public readonly bool IsValid => Type != PacketType.Invalid; public static readonly PacketInfo InvalidPacket = new(PacketType.Invalid, -1); - public PacketInfo(PacketType type, int id) - { - Type = type; - FromId = id; - } - public readonly void Serialize(Span<byte> span) { span[0] = (byte)Type; |
