コード例 #1
0
        static void Main(string[] args)
        {
            CustomLogger.InitializeLogger("C:/logs/pokerLogs.txt");

            var handEvaluator = new HandEvaluator();
            var poker = new Poker.PokerGame.Poker(new StaticBlindsController(10));
            poker.AddPlayer(new Player(new ConsolePlayerController(), new Wallet(15000)) { Name = "Benas" });
            poker.AddPlayer(new Player(new AlwaysCallPlayerController(), new Wallet(10000)) { Name = "Benas2" });
            poker.OnChange(() => Update(poker, handEvaluator));
            poker.Start(() => false);
        }
コード例 #2
0
        public GameController()
        {
            ViewModel = new GameViewModel(this);
            PokerGameObject = new Poker.PokerGame.Poker(new StaticBlindsController(10));
            View = new GameView() { DataContext = ViewModel };
            PokerGameObject.OnChange(UpdateUI);

            token = tokenSource.Token;

            var task = Task.Factory.StartNew(() =>
            {
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas1"});
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas2"});
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas3"});
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas4"});
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas5"});
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas6"});
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas7"});
                PokerGameObject.AddPlayer(new Player(this, new Wallet(1000)) {Name = "Benas8"});
                PokerGameObject.Start(() => token.IsCancellationRequested);
            }, token);

            View.Closed += (sender, args) => tokenSource.Cancel();
        }