Ejemplo n.º 1
0
        public static void InitGameObjectss(TestContext testContext)
        {
            players = new List<IPlayer>();
            
            IPlayer human = PlayerFactory.CreateHuman("human", 10000, new Label(), new TextBox(), AnchorStyles.Bottom, 100, 100);
            players.Add(human);

            IAILogicProvider logicProvider = new AILogicProvider();
            IAIPlayer AI1 = PlayerFactory.CreateAI(logicProvider, "AI1", 10000, new Label(), new TextBox(), AnchorStyles.Bottom, 100, 100);
            players.Add(AI1);
            IAIPlayer AI2 = PlayerFactory.CreateAI(logicProvider, "AI2", 10000, new Label(), new TextBox(), AnchorStyles.Bottom, 100, 100);
            players.Add(AI2);
            IAIPlayer AI3 = PlayerFactory.CreateAI(logicProvider, "AI3", 10000, new Label(), new TextBox(), AnchorStyles.Bottom, 100, 100);
            players.Add(AI3);
            IAIPlayer AI4 = PlayerFactory.CreateAI(logicProvider, "AI4", 10000, new Label(), new TextBox(), AnchorStyles.Bottom, 100, 100);
            players.Add(AI4);
            IAIPlayer AI5 = PlayerFactory.CreateAI(logicProvider, "AI5", 10000, new Label(), new TextBox(), AnchorStyles.Bottom, 100, 100);
            players.Add(AI5);

            dealer = new Dealer(100, 100);

            deck = new MockDeck();

            handHandler = new HandTypeHandler();
        }
Ejemplo n.º 2
0
        public GameForm()
        {
            this.InitializeComponent();

            this.timer.Interval = 1000;
            this.timer.Tick += this.TimerTick;
            this.updates.Interval = 100;
            this.updates.Tick += this.UpdateTick;

            this.textboxBigBlind.Visible = false;
            this.textboxSmallBlind.Visible = false;
            this.buttonBigBlind.Visible = false;
            this.buttonSmallBlind.Visible = false;
            this.textboxRaise.Text = (AppSettigns.DefaultMinBigBlind * 2).ToString();

            IPlayer human = this.GetHumanPlayer();
            IAILogicProvider logicProvider = new AILogicProvider();
            ICollection<IAIPlayer> enemies = this.GetEnemies(logicProvider);
            IPot pot = new Pot(this.textboxPot);
            IDealer dealer = this.GetDealer();
            IDeck deck = Deck.Instance;
            this.messageWriter = new MessageBoxWriter();
            IHandTypeHandler handTypeHandler = new HandTypeHandler();

            this.engine = new GameEngine(human, enemies, pot, dealer, deck, this.messageWriter, handTypeHandler);
            this.engine.GameEngineStateEvent += this.ChangeGameEngineStateHandler;
            this.updates.Start();
            this.engine.Run();
        }