コード例 #1
0
        Card TopCard; // this is our playing card

        // constructors
        public Crazy8Game(Crazy8Graphics board_)
            : base()
        {
            board = board_;

            // setup the players
            for (int i = 0; i < PlayerList.Length; ++i)
            {
                PlayerList[i] = new Crazy8Player("Player " + i, i, 5);
            }

            board.HideNonCrazy8Buttons();
        }
コード例 #2
0
        public Form1()
        {
            InitializeComponent();

            Settings = new SettingsFile("settings.xml");

            // setup window
            this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true);
            this.Text = Settings["window_title"];


            this.Size = new Size(Convert.ToInt32(Settings["width"]), Convert.ToInt32(Settings["height"]));


            // set the game type
            if (Settings["game"] == "Crazy8")
            {
                game = GameType.CRAZY8;
            }
            else if (Settings["game"] == "Poker")
            {
                game = GameType.POKER;
            }
            else if (Settings["game"] == "Blackjack")
            {
                game = GameType.BLACKJACK;
            }


            // initialize the games

            switch (game)
            {
            case GameType.POKER:
                PokerBoard = new PokerGraphics(this.Width, this.Height, Settings["picture_list"]);
                Poker      = new PokerGame(PokerBoard);
                Poker.Play();
                break;

            case GameType.CRAZY8:
                Crazy8Board = new Crazy8Graphics(this.Width, this.Height, Settings["picture_list"]);
                Crazy8      = new Crazy8Game(Crazy8Board);
                Crazy8.Play();
                break;
            }
        }