Example #1
0
        public hs_list_gui(Form owner_, hs_data data_)
        {
            data  = data_;
            owner = owner_;

            InitializeComponent();
        }
Example #2
0
 public enter_hs_gui(hs_data data_, TextIntSetter add_entry_, Form owner_)
 {
     this.data      = data_;
     this.add_entry = add_entry_;
     this.owner     = owner_;
     InitializeComponent();
 }
Example #3
0
        static void Main()
        {
            /* Notes for high score handling
             *   Create a new controller for the hs forms
             *   Let this controller control the end game forms and hs list
             *   Give the game controller a handle to running the end game form
             *   Give the yahtzee gui a handle to the hs list form  */

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            /* create models */
            game_data gd  = new game_data();
            hs_data   hsd = new hs_data();

            /* create controllers */
            game_controller c   = new game_controller(gd);
            hs_controller   hsc = new hs_controller(hsd);

            /* create views */
            yahtzee_gui  gui       = new yahtzee_gui(c.roll_dice, c.score_roll, c.new_game, gd);
            hs_list_gui  hs_gui    = new hs_list_gui(gui, hsd);
            enter_hs_gui entry_gui = new enter_hs_gui(hsd, hsc.add_entry, gui);
            end_game_gui end_gui   = new end_game_gui(gui);

            /* register delegates */
            c.register_sel_cat_getter(gui.get_sel_cat);
            c.register_lock_dice_getter(gui.get_lock_dice);
            c.register_updater(gui.update);
            c.register_end_game(end_gui.run);
            c.register_hs_getter(hsc.is_high_score);
            c.register_hs_entry(entry_gui.run);
            gui.register_hs_list(hs_gui.run);

            /* run application */
            gui.run();
        }
Example #4
0
 public hs_controller(hs_data data_)
 {
     data = data_;
     read_hs_file();
 }