You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1018 B
C#
45 lines
1018 B
C#
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})";
|
|
}
|
|
}
|
|
}
|