Ejemplo n.º 1
0
 public Bet GetBetFromRecord(BetRecord bet)
 {
     DateTime newDate = bet.Date.DateTime;
     User newUser = GetUserFromRecord(bet);
     GameCode newCode = GetGameCodeFromRecord(bet);
     Bet newBet = new Bet { Date = newDate, User = newUser, GameCode = newCode, Value = bet.Amount};
     return newBet;
 }
Ejemplo n.º 2
0
 public void AddNewBet(string username, int gamecode, int amount)
 {
     BetRecord newBet = new BetRecord(username, gamecode, amount);
     _logger.Add(newBet);
     using (StreamWriter file = new StreamWriter(_loggerPath, true))
     {
         file.WriteLine(newBet.ToString());
     }
 }
Ejemplo n.º 3
0
 public GameCode GetGameCodeFromRecord(BetRecord bet)
 {
     GameCode res = 0;
     switch (bet.GameCode)
     {
         case 1:
             res = GameCode.BJ;
             break;
         case 2:
             res = GameCode.Dice;
             break;
         case 3:
             res = GameCode.Roulet;
             break;
     }
     return res;
 }