Пример #1
0
        public Player(PlayerModel p, LocatorService ls)
        {
            _areaLocator    = ls.AreaLocator;
            _shipLocator    = ls.ShipLocator;
            _accountLocator = ls.AccountLocator;
            _teamLocator    = ls.TeamLocator;

            _model = p;
        }
 public PendingStockActions(IStockPriceProvider priceProvider, IAccountLocator accountLocator, IAccountPersister accountPersister)
 {
     this.priceProvider = priceProvider;
     this.accountLocator = accountLocator;
     this.accountPersister = accountPersister;
     this.hubContext = GlobalHost.ConnectionManager.GetHubContext<StockTraderHub>();
     this.pendingActions = new List<PendingAction>();
     this.pendingActionsTimer = new Timer(this.PendingActionsCallback, null, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(3));
 }
Пример #3
0
        public IEnumerable <Player> GetAllPlayers(IAreaLocator al, IShipLocator sl, IAccountLocator acl, ITeamLocator tl, ITeamManager tm)
        {
            IEnumerable <DBPlayer> allPlayers = _galacticObjectContext.Players;

            List <Player> acc = new List <Player>();

            foreach (DBPlayer p in allPlayers)
            {
                acc.Add(new Player(p, al, sl, acl, tl, tm));
            }

            return(acc);
        }
Пример #4
0
        public Player(int playerID, string name, Account account, LocatorService ls)
        {
            _model = new PlayerModel();

            _model.Id = playerID;
            Username  = name;

            IsOnline        = false;
            CheatEngineOpen = false;
            HackCount       = -1;

            _areaLocator    = ls.AreaLocator;
            _shipLocator    = ls.ShipLocator;
            _accountLocator = ls.AccountLocator;
            _teamLocator    = ls.TeamLocator;

            _model.AccountID = account.Id;

            _model.DefaultTeamID = ls.TeamManager.CreateNewTeam(this);
            _model.TeamIDs.Add((int)_model.DefaultTeamID);
            _model.PlayerType = PlayerTypes.Human;
        }
Пример #5
0
 public LocatorService(IGalaxyRegistrationManager grm,
                       IPlayerLocator pl,
                       IAreaLocator al,
                       IShipLocator sl,
                       IAccountLocator acl,
                       ITeamLocator tl,
                       ITeamManager tm,
                       IMessageManager mm,
                       IObjectLocator <IStructure> structureManager,
                       ISlaveIDProvider slaveIDProvider)
 {
     PlayerLocator       = pl;
     ShipLocator         = sl;
     AccountLocator      = acl;
     TeamLocator         = tl;
     TeamManager         = tm;
     AreaLocator         = al;
     MessageManager      = mm;
     RegistrationManager = grm;
     StructureManager    = structureManager;
     SlaveIDProvider     = slaveIDProvider;
 }
Пример #6
0
 public StockTraderHub(IAccountLocator accountLocator, IStocksUpdater stocksUpdater, IStockBroker stockBroker) {
     this.accountLocator = accountLocator;
     this.stocksUpdater = stocksUpdater;
     this.stockBroker = stockBroker;
 }
Пример #7
0
 public void Test(IDatabaseManager dbm, IPlayerLocator pl, IAreaLocator al, ITeamLocator tl, IShipLocator sl, IMessageManager mm, IAccountLocator acl, ITeamManager tm)
 {
 }
Пример #8
0
        /// <summary>
        /// Returns null if player not found
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Player GetPlayer(int id, IAreaLocator al, IShipLocator sl, IAccountLocator acl, ITeamLocator tl, ITeamManager tm)
        {
            DBPlayer p = _galacticObjectContext.Players.First(ee => ee.Id == id);

            return(p != null ? new Player(p, al, sl, acl, tl, tm) : null);
        }