mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
50
Assets/GameScripts/DotNet/Model/Share/LockStep/LSInput.cs
Normal file
50
Assets/GameScripts/DotNet/Model/Share/LockStep/LSInput.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user