public GameStateAcceptingPlayers(TwitchGameController controller) : base(controller) { waitingToStartTimer = new Timer(TimeSpan.FromMinutes(5), AnnounceGame); roundTimer = new TimerSet( new TimeSpan[] { TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(20) }, new Action[] { TimeUp, FinalTimeUp }); }
public void UserInput_IsFalse() { var TimerSet = new TimerSet(); var userInput = "??:)):00"; Assert.Throws <FormatException>(() => TimerSet.SetTimer(userInput)); }
public void UserInput_IsBlank() { //arrange var TimerSet = new TimerSet(); var userInput = ""; //act //assert Assert.Throws <FormatException>(() => TimerSet.SetTimer(userInput)); }
public BJStatePlay(TwitchBlackjack controller) : base(controller) { timers = new TimerSet( new TimeSpan[] { TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(5) }, new Action[] { TimeUp1, TimeUp2, FinalTimeUp }); insuranceTimer = new Timer(TimeSpan.FromSeconds(20), NoMoreInsurance); AddCommand(controller.room, "hit", HitCommand, "Draw another card.", null, false, null, false); AddCommand(controller.room, "double", DoubleCommand, "Double your bet and get exactly one more card (then you stand).", null, false, null, false); AddCommand(controller.room, "split", SplitCommand, "Splits two cards of the same value. You play each hand separately, and each hand is playing for your opening bet.", null, false, null, false); AddCommand(controller.room, "stand", StandCommand, "Ends your turn.", null, false, null, false); AddCommand(controller.room, "surrender", SurrenderCommand, "Surrender takes half your bet and kicks you out of the game.", null, false, null, false); }
public void UserInputs_CorrectTime() { //arrange var TimerSet = new TimerSet(); var userInput = "00:00:25"; //act TimerSet.SetTimer(userInput); var parsedTime = TimerSet.ParsedTime; //assert Assert.Equal(TimeSpan.Parse("00:00:25"), parsedTime); }
public HoldemStatePlay(TwitchHoldem controller) : base(controller) { AddCommand(controller.room, "call", CallCommand, "Call...", null, false, null, false); AddCommand(controller.room, "raise", RaiseCommand, "Raise...", null, false, null, false); AddCommand(controller.room, "check", CheckCommand, "Check...", null, false, null, false); AddCommand(controller.room, "fold", FoldCommand, "Fold...", null, false, null, false); AddCommand(controller.room, "bet", BetCommand, "Bet...", null, false, null, false); AddCommand(controller.room, "allin", AllInCommand, "Bet or Raise all in...", null, false, null, false); timer = new TimerSet(new TimeSpan[] { TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(30) }, new Action[] { WarningTimer, WarningTimer, FinalTimer }); lastKnownPlayer = controller.game.currentPlayer; PlayerChanged(); timer.Start(); playersLookingToFold.Clear(); }