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; } }
// constructors public PokerGame(PokerGraphics board_) : base() { board = board_; }