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:
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public partial class OneFrameInputs
|
||||
{
|
||||
protected bool Equals(OneFrameInputs other)
|
||||
{
|
||||
return Equals(this.Inputs, other.Inputs);
|
||||
}
|
||||
|
||||
public void CopyTo(OneFrameInputs to)
|
||||
{
|
||||
to.Inputs.Clear();
|
||||
foreach (var kv in this.Inputs)
|
||||
{
|
||||
to.Inputs.Add(kv.Key, kv.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(this, obj))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj.GetType() != this.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Equals((OneFrameInputs) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(this.Inputs);
|
||||
}
|
||||
|
||||
public OneFrameInputs()
|
||||
{
|
||||
this.Inputs = new Dictionary<long, LSInput>(LSConstValue.MatchCount);
|
||||
}
|
||||
|
||||
public static bool operator==(OneFrameInputs a, OneFrameInputs b)
|
||||
{
|
||||
if (a is null || b is null)
|
||||
{
|
||||
if (a is null && b is null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.Inputs.Count != b.Inputs.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var kv in a.Inputs)
|
||||
{
|
||||
if (!b.Inputs.TryGetValue(kv.Key, out LSInput inputInfo))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (kv.Value != inputInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool operator !=(OneFrameInputs a, OneFrameInputs b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Room2C_Start
|
||||
{
|
||||
public Room2C_Start()
|
||||
{
|
||||
this.UnitInfo = new List<LockStepUnitInfo>(LSConstValue.MatchCount);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user