public void SetStats() { GameStatList = GetData(); foreach (var item in GameStatList) { if (item.GameID == gameID) { requiredGameStat = item; leftRounds = item.LeftRounds; alottedCredit = item.CreditAlotted; spentCredit = item.SpentCredit; wonCredit = item.WonCredit; isFreeDraw = bool.Parse(item.FreeDraw); } } }
public IHttpActionResult StartGame(DrawGameStat GameStats) { GameStats.GameID = Guid.NewGuid(); GameStats.CreditAlotted = GameStats.RoundIterations * 20; GameStats.TotalBalls = 20; GameStats.DrawCost = 10; GameStats.SpentCredit = 0; GameStats.WonCredit = 0; GameStats.LeftRounds = GameStats.RoundIterations; GameStats.WinBonus = 20; GameStats.RTP = 0; GameStats.FreeDraw = "false"; entities.DrawGameStats.Add(GameStats); entities.SaveChanges(); drawBallModel.StartPlay(GameStats.RoundIterations); DrawBallModel.gameID = GameStats.GameID; return(Ok <DrawGameStat>(GameStats)); }