コード例 #1
0
        /// <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);
        }
コード例 #2
0
 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>();
 }
コード例 #3
0
        public PlayerListenerContainer(IPlayerEntityManagerStore playerEntityManagerStore,
                                       BattleListenerContainer battleListenerContainer,
                                       IHubContext <WorldEntityHub> hubContext)
        {
            _managerStore = playerEntityManagerStore;
            _managerStore.OnPlayerEntityManagerCreated += OnCreated;

            _battleListenerContainer = battleListenerContainer;
            _hubContext = hubContext;
            _listeners  = new Dictionary <PlayerEntityManager, PlayerManagerListener>();
        }
コード例 #4
0
ファイル: BattleHub.cs プロジェクト: KeithThor/trpg-server
 public BattleHub(IStateManager stateManager,
                  IPlayerEntityManagerStore playerEntityManagerStore)
 {
     _stateManager             = stateManager;
     _playerEntityManagerStore = playerEntityManagerStore;
 }