/// <summary> /// Creates a new PlayerEntityManager for the user of the given id. /// </summary> /// <param name="playerId">The id of the player to create a manager for.</param> /// <param name="playerEntityManagerStore">The </param> /// <returns></returns> public PlayerEntityManager Create(Guid playerId, IPlayerEntityManagerStore playerEntityManagerStore) { var manager = new PlayerEntityManager(_worldState, _stateManager, playerEntityManagerStore) { PlayerId = playerId }; return(manager); }
public PlayerEntityManager(IWorldState worldState, IStateManager stateManager, IPlayerEntityManagerStore playerEntityManagerStore) { _worldState = worldState; _stateManager = stateManager; _playerEntityManagerStore = playerEntityManagerStore; LastAccessed = DateTime.Now; _movementQueue = new Queue <Coordinate>(); AlliedEntities = new List <WorldEntity>(); }
public PlayerListenerContainer(IPlayerEntityManagerStore playerEntityManagerStore, BattleListenerContainer battleListenerContainer, IHubContext <WorldEntityHub> hubContext) { _managerStore = playerEntityManagerStore; _managerStore.OnPlayerEntityManagerCreated += OnCreated; _battleListenerContainer = battleListenerContainer; _hubContext = hubContext; _listeners = new Dictionary <PlayerEntityManager, PlayerManagerListener>(); }
public BattleHub(IStateManager stateManager, IPlayerEntityManagerStore playerEntityManagerStore) { _stateManager = stateManager; _playerEntityManagerStore = playerEntityManagerStore; }