protected override void ConsumePacket(Connection connection, PlayerPositionPacket packet) { var player = _entitySet.Get(packet.SteamId); if (player == null) { return; } player.X = packet.X; player.Y = packet.Y; }
protected override void ConsumePacket(Connection connection, PlayerMovePacket packet) { var player = _entitySet.Get(packet.SteamId); if (player == null) { return; } player.XDirection = packet.XDirection; player.FacingDirection = packet.XDirection != 0 ? packet.XDirection : player.FacingDirection; }
protected override void ConsumePacket(Connection connection, JumpPacket packet) { var player = _entitySet.Get(packet.SteamId); if (player == null) { return; } var jumpComponent = player.GetComponent <JumpComponent>(); if (packet.IsStopping) { jumpComponent.EndJump(); } else { jumpComponent.BeginJump(); } }
public TEntityDto Get(EntityId id) { return(_converter.Invoke(_source.Get(id))); }