mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(SyncList): Change Callback to Action
This commit is contained in:
parent
f2d43de036
commit
f2b89867a0
@ -15,8 +15,7 @@ public enum Operation : byte
|
||||
OP_CLEAR
|
||||
}
|
||||
|
||||
public delegate void SyncListChanged(Operation op, int itemIndex, T oldItem, T newItem);
|
||||
public event SyncListChanged Callback;
|
||||
public Action<Operation, int, T, T> Callback;
|
||||
|
||||
readonly IList<T> objects;
|
||||
readonly IEqualityComparer<T> comparer;
|
||||
|
@ -48,7 +48,7 @@ public void OldValueShouldNotBeNewValue()
|
||||
serverList[0] = player;
|
||||
|
||||
bool callbackCalled = false;
|
||||
clientList.Callback += (SyncList<TestPlayer>.Operation op, int itemIndex, TestPlayer oldItem, TestPlayer newItem) =>
|
||||
clientList.Callback = (SyncList<TestPlayer>.Operation op, int itemIndex, TestPlayer oldItem, TestPlayer newItem) =>
|
||||
{
|
||||
Assert.That(op == SyncList<TestPlayer>.Operation.OP_SET, Is.True);
|
||||
Assert.That(itemIndex, Is.EqualTo(0));
|
||||
|
@ -278,7 +278,7 @@ public void CallbackTest()
|
||||
{
|
||||
bool called = false;
|
||||
|
||||
clientSyncList.Callback += (op, index, oldItem, newItem) =>
|
||||
clientSyncList.Callback = (op, index, oldItem, newItem) =>
|
||||
{
|
||||
called = true;
|
||||
|
||||
@ -299,7 +299,7 @@ public void CallbackRemoveTest()
|
||||
{
|
||||
bool called = false;
|
||||
|
||||
clientSyncList.Callback += (op, index, oldItem, newItem) =>
|
||||
clientSyncList.Callback = (op, index, oldItem, newItem) =>
|
||||
{
|
||||
called = true;
|
||||
|
||||
@ -318,7 +318,7 @@ public void CallbackRemoveAtTest()
|
||||
{
|
||||
bool called = false;
|
||||
|
||||
clientSyncList.Callback += (op, index, oldItem, newItem) =>
|
||||
clientSyncList.Callback = (op, index, oldItem, newItem) =>
|
||||
{
|
||||
called = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user