mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
50 lines
1.0 KiB
C#
50 lines
1.0 KiB
C#
using System;
|
|
using MemoryPack;
|
|
|
|
namespace ET
|
|
{
|
|
[MemoryPackable]
|
|
public partial struct LSInput
|
|
{
|
|
[MemoryPackOrder(0)]
|
|
public TrueSync.TSVector2 V;
|
|
|
|
[MemoryPackOrder(1)]
|
|
public int Button;
|
|
|
|
public bool Equals(LSInput other)
|
|
{
|
|
return this.V == other.V && this.Button == other.Button;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is LSInput other && Equals(other);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return HashCode.Combine(this.V, this.Button);
|
|
}
|
|
|
|
public static bool operator==(LSInput a, LSInput b)
|
|
{
|
|
if (a.V != b.V)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (a.Button != b.Button)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public static bool operator !=(LSInput a, LSInput b)
|
|
{
|
|
return !(a == b);
|
|
}
|
|
}
|
|
} |