This commit is contained in:
2025-03-28 15:24:44 +02:00
parent cc9eacca8d
commit 6783efdb6a
25 changed files with 1077 additions and 364 deletions

View File

@@ -84,21 +84,21 @@ public class PlayerInput2 : IPlayerInput
public class PlayerInputNetwork2 : IPlayerInput
{
private uint _playerId;
private WorldStateManager _worldStateManager;
private World _world;
private ulong _frame;
private PlayerInputState2 _state;
public PlayerInputNetwork2(uint playerId, WorldStateManager worldStateManager)
public PlayerInputNetwork2(uint playerId, World world)
{
_playerId = playerId;
_worldStateManager = worldStateManager;
_world = world;
}
public void SetFrame(ulong frame) => _frame = frame;
public void UpdateState()
{
_worldStateManager.GetPlayerInputState(_playerId, _frame, out _state);
_world.GetPlayerInputState(_playerId, _frame, out _state);
}
public PlayerInputState2 GetState() => _state;
@@ -107,4 +107,15 @@ public class PlayerInputNetwork2 : IPlayerInput
{
_state = new PlayerInputState2();
}
}
public class PlayerInputNone : IPlayerInput
{
public static PlayerInputNone Instance { get; } = new PlayerInputNone();
private PlayerInputNone() { }
public PlayerInputState2 GetState() => default;
public void ResetState() { }
public void SetFrame(ulong frame) { }
public void UpdateState() { }
}