Пример #1
0
        public void PurchaseTicket(DateTime drawDate, int playerId, int[] numbers, decimal value)
        {
            if (!_draws.ContainsKey(drawDate))
            {
                throw new DrawNotOpenException();
            }
            Draw        d      = _draws[drawDate];
            IPlayerInfo player = _playerManager.GetPlayer(playerId);

            _playerManager.AdjustBalance(playerId, -1 * value);
            d.AddTicket(new Ticket(player, drawDate, numbers, value));
        }
Пример #2
0
        public void PlayerBalance(String player, decimal balance)
        {
            PlayerRegistrationInfo p = new PlayerRegistrationInfo();

            p.Username = player; p.Name = player;
            p.Password = "******";
            // define other mandatory properties
            int playerId = _playerManager.RegisterPlayer(p);

            _playerManager.AdjustBalance(playerId, balance);
        }