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); }
public Controller(IView theView, Game theGame, FileHandler theFiler, LevelBuilder theBuilder) { view = theView; game = theGame; filer = theFiler; builder = theBuilder; filer.Init(); game.Init(view, filer); }
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(); }
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(); }
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; } }