public void Delete(int id) { PlayingStyle playingStyle = context.PlayingStyles.Find(id); context.PlayingStyles.Remove(playingStyle); Save(); }
public PlayingStyle Update(PlayingStyle playingStyle) { context.Entry(playingStyle).State = System.Data.Entity.EntityState.Modified; Save(); return(playingStyle); }
public PlayingStyle Add(PlayingStyle playingStyle) { var result = context.PlayingStyles.Add(playingStyle); Save(); return(result); }
public Champion(PlayerStyles style, int buyIn) { var playingStyle = new PlayingStyle(); switch (style) { case PlayerStyles.TIGHT_AGGRESSIVE: break; case PlayerStyles.LOOSE_AGGRESSIVE: playingStyle.VPIP = new VPIP(this.Name, 100, 24); playingStyle.PFR = new PFR(this.Name, 100, 18); var rfi = new Dictionary <SeatNames, RFI>(); rfi.Add(SeatNames.UTG, new RFI(1000, 15, 100)); rfi.Add(SeatNames.MP, new RFI(1000, 17, 100)); rfi.Add(SeatNames.CO, new RFI(1000, 25, 100)); rfi.Add(SeatNames.BTN, new RFI(1000, 48, 100)); rfi.Add(SeatNames.SB, new RFI(1000, 49, 100)); rfi.Add(SeatNames.BB, new RFI(1000, 0, 100)); playingStyle.RFI = new PositionStorage <RFI>(this.Name, rfi); playingStyle.ThreeBet = new StreetStorage <ThreeBet>( new Dictionary <GameRoundType, ThreeBet> { { GameRoundType.PreFlop, new ThreeBet(1000, 61, 1000) } }); playingStyle.FourBet = new StreetStorage <FourBet>( new Dictionary <GameRoundType, FourBet> { { GameRoundType.PreFlop, new FourBet(1000, 23, 1000) } }); var cbet = new Dictionary <GameRoundType, CBet>(3); cbet.Add(GameRoundType.Flop, new CBet(this.Name, 100, 60, 100)); cbet.Add(GameRoundType.Turn, new CBet(this.Name, 100, 58, 100)); cbet.Add(GameRoundType.River, new CBet(this.Name, 100, 41, 100)); playingStyle.CBet = new StreetStorage <CBet>(cbet); var afq = new Dictionary <GameRoundType, AFq>(3); afq.Add(GameRoundType.Flop, new AFq(100, 100, 198, 0)); afq.Add(GameRoundType.Turn, new AFq(100, 100, 158, 0)); afq.Add(GameRoundType.River, new AFq(100, 100, 300, 0)); playingStyle.AFq = new StreetStorage <AFq>(afq); break; default: throw new ArgumentException("Player style not found"); } this.playingStyle = playingStyle; this.BuyIn = buyIn; this.preflopBehavior = new PreflopBehavior(playingStyle); this.postflopBehavior = new PostflopBehavior(playingStyle); }
public IHttpActionResult Put([FromBody] PlayingStyle playingStyle) { var result = new PlayingStyle(); if (ModelState.IsValid) { result = playingStyleRepository.Update(playingStyle); } return(Json(result)); }