コード例 #1
0
ファイル: MainWindowViewModel.cs プロジェクト: jatwigg/bg
        private void start()
        {
            // build a game like this
            _game = new SimpleGameBuilder()
                // rules define cards and stuff that can use properties of cards
                .WithRule<DefaultTileset>()
                .WithRule<CityRule>()
                .WithRule<FarmersRule>()
                .WithRule<PriestsRule>()
                .WithRule<HighwaymanRule>()
                // with players
                .WithPlayer<SimpleComputerPlayer>()
                .WithPlayer(Player)
                // build the game
                .Build();

            // attach an observer of the game (UI representation)
            _game.AddObserver(this);

            // play a game like this
            _game.Start();
        }