wip
This commit is contained in:
@@ -15,13 +15,12 @@ public class Entity
|
||||
public ushort StaticId { get; private set; }
|
||||
public ushort EntityType { get; private set; }
|
||||
public ushort OwnerId { get; private set; }
|
||||
public byte[] Payload { get; private set; }
|
||||
public RagonAuthority Authority { get; private set; }
|
||||
|
||||
private List<EntityProperty> _properties;
|
||||
private List<EntityEvent> _bufferedEvents;
|
||||
|
||||
public byte[] Payload { get; set; }
|
||||
|
||||
public Entity(GameRoom room, ushort ownerId, ushort entityType, ushort staticId, RagonAuthority eventAuthority)
|
||||
{
|
||||
OwnerId = ownerId;
|
||||
|
||||
@@ -36,7 +36,9 @@ namespace Ragon.Core
|
||||
private List<ushort> _peersCache = new List<ushort>();
|
||||
private List<ushort> _awaitingPeers = new List<ushort>();
|
||||
|
||||
public Player GetPlayerById(ushort peerId) => _players[peerId];
|
||||
public Player GetPlayerByPeer(ushort peerId) => _players[peerId];
|
||||
|
||||
public Player GetPlayerById(string id) => _players.Values.FirstOrDefault(p => p.Id == id)!;
|
||||
|
||||
public Entity GetEntityById(int entityId) => _entities[entityId];
|
||||
|
||||
@@ -280,7 +282,6 @@ namespace Ragon.Core
|
||||
public void Tick(float deltaTime)
|
||||
{
|
||||
_scheduler.Tick(deltaTime);
|
||||
|
||||
SendChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,5 +8,7 @@ public interface IGameRoom
|
||||
public int PlayersMax { get; }
|
||||
public int PlayersCount { get; }
|
||||
|
||||
public Player GetPlayerById(string id);
|
||||
public Player GetPlayerByPeer(ushort peerId);
|
||||
public Entity GetEntityById(int entityId);
|
||||
}
|
||||
@@ -183,12 +183,12 @@ namespace Ragon.Core
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool OnEntityCreated(Player creator, Entity entity)
|
||||
public virtual bool OnEntityCreated(Player player, Entity entity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool OnEntityDestroyed(Player destoyer, Entity entity)
|
||||
public virtual bool OnEntityDestroyed(Player player, Entity entity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user