示例#1
0
        public void SetText(string newText)
        {
            theFile = newText;

            if (filer == null)
            {
                filer = new FileHandler();
                filer.Init();
            }

            mapTested = false;
            mapValid = false;
            tbxPreview.Location = new Point(15, 15);
            tbxPreview.Text = filer.LoadTextFile(theFile);
            //tbxPreview.Font = new Font("Courier", 15);
            tbxPreview.ScrollBars = ScrollBars.Both;
            SetTbxDimensions();
            tbxPreview.WordWrap = false;
            tbxPreview.ReadOnly = true;

            lblResult.Text = "";
            lblResult.Location = new Point(tbxPreview.Location.X, tbxPreview.Location.Y + tbxPreview.Size.Height + 20);

            btnTestMap.Location = new Point(tbxPreview.Location.X, lblResult.Location.Y + lblResult.Size.Height + 60);
        }
示例#2
0
        public Controller(IView theView, Game theGame, FileHandler theFiler, LevelBuilder theBuilder)
        {
            view    = theView;
            game    = theGame;
            filer   = theFiler;
            builder = theBuilder;

            filer.Init();
            game.Init(view, filer);
        }
示例#3
0
        public void Init(int theList, string newMap)
        {
            currentMap = newMap;
            currentList = theList;
            filer = new FileHandler();
            game = new Game();
            mediaPath = @"H:\2015\semester 2\PR 283 C#\Theseus\TheseusFormed - Test\media";

            filer.Init();
            filer.SetMap(theList, newMap);
            game.SetFiler(filer);
            LoadMap();
        }
示例#4
0
        public void Init(int theList, string newMap)
        {
            currentMap = newMap;
            currentList = theList;
            filer = new FileHandler();
            game = new Game();
            mediaPath = Painter.SetMediaPath();

            filer.Init();
            filer.SetMap(theList, newMap);
            game.SetFiler(filer);
            LoadMap();
        }
示例#5
0
        private void btnTestMap_Click(object sender, EventArgs e)
        {
            if (filer == null)
            {
                filer = new FileHandler();
                filer.Init();
            }

            if (!filer.TestImportedMap(theFile))
            {
                lblResult.Text = "Sorry, the text file was not in one of the correct formats.\nPress 'N' to select a different file to import\nPress Enter to return to the main menu";
                mapTested = true;
            }
            else
            {
                lblResult.Text = "The map was successfully validated.\nPress Spacebar to open the map in the Editor,\nPress 'N' to select a different file to import\nPress Enter to return to the main menu";
                mapTested = true;
                mapValid = true;
            }
        }
示例#6
0
        public Controller(IView theView, Game theGame, FileHandler theFiler, LevelBuilder theBuilder)
        {
            view = theView;
            game = theGame;
            filer = theFiler;
            builder = theBuilder;

            filer.Init();
            game.Init(view, filer);
        }