summaryrefslogtreecommitdiff
path: root/Net.cs
diff options
context:
space:
mode:
authorSarah B <git@sarahduck.ca>2023-12-24 21:04:19 -0800
committerSarah B <git@sarahduck.ca>2023-12-24 21:04:19 -0800
commit0206e04e0a3542b8f0fc97996f1d885f7604a6fa (patch)
tree575f1388978b110064993445b73dcf268218a750 /Net.cs
parentc4dd5d6fe58a21f9cab5ce271cd3554c2fe791e3 (diff)
network mouse click, restructure oneko, add framework for NPCState stuff
Diffstat (limited to 'Net.cs')
-rw-r--r--Net.cs16
1 files changed, 5 insertions, 11 deletions
diff --git a/Net.cs b/Net.cs
index 3fa5f8a..4bf984e 100644
--- a/Net.cs
+++ b/Net.cs
@@ -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;