Exemplo n.º 1
0
        public MainForm(SerializationInfo si, StreamingContext sc)
        {
            //todo: odstranit button1
            model = (GameRecords)si.GetValue("model", typeof(GameRecords));
            view = (View2)si.GetValue("view", typeof(View2));
            view.form = this;
            playingHeight = si.GetByte("height");
            playingWidth = si.GetByte("width");
            InitializeComponent();
            InitializeTasks();
            timerTicks = 0;
            IsMdiContainer = true;
            accessoriesToolStripMenuItem.Checked = false;
            amusform = new AmusementsForm(model, mainDockPanel, amusementsToolStripMenuItem);
            pathform = new PathForm(model, pathToolStripMenuItem);
            accform = new AccessoriesForm(model, accessoriesToolStripMenuItem);
            mapform = new MapForm(model, view, playingWidth, playingHeight);
            PrepareFormsStartAppearance(model.currOfferedAmus, model.currOfferedPaths, model.currOfferedOthers, model.images);
            amusform.Show(mainDockPanel);
            pathform.Show(mainDockPanel);

            view.form = this;
            mapform.InitializeAfterDeserialization(model, view);

            timer.Enabled = true;
            MyUpdate();
            this.Refresh();
        }
Exemplo n.º 2
0
        public MainForm(byte playingWidth, byte playingHeight, StartForm startForm)
        {
            InitializeComponent();
            InitializeTasks();
            IsMdiContainer = true;
            this.playingHeight = playingHeight;
            this.playingWidth = playingWidth;
            this.startForm = startForm;

            model = new GameRecords(playingHeight, playingWidth, startForm.initialAmusementsFilename, startForm.initialPathsFilename, startForm.initialAccessoriesFilename, startForm.revealingRulesFilename);

            amusform = new AmusementsForm(model, mainDockPanel, amusementsToolStripMenuItem);
            pathform = new PathForm(model, pathToolStripMenuItem);
            accform = new AccessoriesForm(model, accessoriesToolStripMenuItem);
            view = new View2(model, this);
            mapform = new MapForm(model, view, playingWidth, playingHeight);

            amusform.Show(mainDockPanel);
            pathform.Show(mainDockPanel);
            accessoriesToolStripMenuItem.Checked = false;
            mapform.Show(mainDockPanel);
            timer.Enabled = true;
        }