This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
/
DiffStorage.cs
79 lines (66 loc) · 2.42 KB
/
DiffStorage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using Improbable.Gdk.Core.Commands;
namespace Improbable.Gdk.Core
{
public interface IComponentDiffStorage
{
Type[] GetEventTypes();
Type GetUpdateType();
uint GetComponentId();
void Clear();
void RemoveEntityComponent(long entityId);
List<EntityId> GetComponentsAdded();
List<EntityId> GetComponentsRemoved();
}
public interface ICommandDiffStorage
{
void Clear();
}
public interface IComponentCommandDiffStorage : ICommandDiffStorage
{
uint GetComponentId();
uint GetCommandId();
Type GetRequestType();
Type GetResponseType();
void RemoveRequests(long entityId);
}
public interface IDiffComponentAddedStorage<T> where T : ISpatialComponentUpdate
{
void AddEntityComponent(long entityId, T component);
}
public interface IDiffAuthorityStorage : IComponentDiffStorage
{
void AddAuthorityChange(AuthorityChangeReceived authorityChange);
ReceivedMessagesSpan<AuthorityChangeReceived> GetAuthorityChanges();
ReceivedMessagesSpan<AuthorityChangeReceived> GetAuthorityChanges(EntityId entityId);
}
public interface IDiffUpdateStorage<T> : IComponentDiffStorage
where T : ISpatialComponentUpdate
{
void AddUpdate(ComponentUpdateReceived<T> update);
ReceivedMessagesSpan<ComponentUpdateReceived<T>> GetUpdates();
ReceivedMessagesSpan<ComponentUpdateReceived<T>> GetUpdates(EntityId entityId);
}
public interface IDiffEventStorage<T> : IComponentDiffStorage
where T : IEvent
{
void AddEvent(ComponentEventReceived<T> ev);
ReceivedMessagesSpan<ComponentEventReceived<T>> GetEvents();
ReceivedMessagesSpan<ComponentEventReceived<T>> GetEvents(EntityId entityId);
}
public interface IDiffCommandRequestStorage<T> : ICommandDiffStorage
where T : struct, IReceivedCommandRequest
{
void AddRequest(T request);
ReceivedMessagesSpan<T> GetRequests();
ReceivedMessagesSpan<T> GetRequests(EntityId targetEntityId);
}
public interface IDiffCommandResponseStorage<T> : ICommandDiffStorage
where T : struct, IReceivedCommandResponse
{
void AddResponse(T response);
ReceivedMessagesSpan<T> GetResponses();
ReceivedMessagesSpan<T> GetResponse(long requestId);
}
}