-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathIEntity.cs
82 lines (51 loc) · 2.42 KB
/
IEntity.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
80
81
82
using System;
using System.Collections.Generic;
using System.Numerics;
namespace AltV.Net.EntitySync
{
public interface IEntity
{
ulong Id { get; }
ulong Type { get; }
bool Exists { get; }
(ulong, ulong) HashKey { get; }
// set position update flag to true in entity when updating position
// thread will normally check if client is near entity
// 1.) when client was near entity and is not anymore stream not, ( no change)
// 2.) when client was not near entity and is now near entity stream in, (no change)
// 3.) when client was not near entity and is still not near entity do nothing, (no change)
// 4.) when client was near entity and is still near entity send client position change, client knows old position, don't send it
Vector3 Position { get; set; }
int Dimension { get; set; }
uint Range { get; set; }
uint RangeSquared { get; }
IClient TempNetOwner { get; set; }
IClient NetOwner { get; set; }
float NetOwnerRange { get; set; }
float TempNetOwnerRange { get; set; }
uint MigrationDistance { get; }
float LastStreamInRange { get; set; }
EntityDataSnapshot DataSnapshot { get; }
IDictionary<string, object> ThreadLocalData { get; }
int StartingXIndex { get; set; }
int StoppingXIndex { get; set; }
int StartingYIndex { get; set; }
int StoppingYIndex { get; set; }
void SetData(string key, object value);
bool TryGetData(string key, out object value);
ICollection<string> GetDataKeys();
bool TryGetData<T>(string key, out T value);
void ResetData(string key);
bool TryAddClient(IClient client);
bool RemoveClient(IClient client);
HashSet<IClient> GetClients();
byte[] Serialize(IEnumerable<string> changedKeys);
ValueTuple<bool, bool, bool> TrySetPropertiesComputing(out Vector3 currOldPosition, out uint currOldRange,
out int currOldDimension, out Vector3 currNewPosition, out uint currNewRange,
out int currNewDimension);
void SetThreadLocalData(string key, object value);
void SetExistsInternal(bool state);
void ResetThreadLocalData(string key);
bool TryGetThreadLocalData(string key, out object value);
}
}