feat: added spawn payload in snapshot, reduce allocations in entity state

This commit is contained in:
2022-05-26 21:05:05 +04:00
parent 35ca016520
commit ec65b9f305
2 changed files with 20 additions and 14 deletions
+2
View File
@@ -10,6 +10,7 @@ public class Entity
public ushort EntityType { get; private set; }
public RagonAuthority Authority { get; private set; }
public EntityState State { get; private set; }
public EntityState Payload { get; private set; }
public Entity(uint ownerId, ushort entityType, RagonAuthority stateAuthority, RagonAuthority eventAuthority)
{
@@ -17,6 +18,7 @@ public class Entity
EntityType = entityType;
EntityId = _idGenerator++;
State = new EntityState(stateAuthority);
Payload = new EntityState(stateAuthority);
Authority = eventAuthority;
}
}