-
Notifications
You must be signed in to change notification settings - Fork 517
/
Copy pathActionID.cs
44 lines (37 loc) · 1018 Bytes
/
ActionID.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using Unity.Netcode;
namespace Unity.BossRoom.Gameplay.Actions
{
/// <summary>
/// This struct is used by Action system (and GameDataSource) to refer to a specific action in runtime.
/// It wraps a simple integer.
/// </summary>
public struct ActionID : INetworkSerializeByMemcpy, IEquatable<ActionID>
{
public int ID;
public bool Equals(ActionID other)
{
return ID == other.ID;
}
public override bool Equals(object obj)
{
return obj is ActionID other && Equals(other);
}
public override int GetHashCode()
{
return ID;
}
public static bool operator ==(ActionID x, ActionID y)
{
return x.Equals(y);
}
public static bool operator !=(ActionID x, ActionID y)
{
return !(x == y);
}
public override string ToString()
{
return $"ActionID({ID})";
}
}
}