Esempio n. 1
0
        public override void Initialize()
        {
            dataLoader = new DataLoader(levelSourcePath);

            data = dataLoader.ReadData(true);

            gameComponents = new World(Game, data);

            base.Initialize();
        }
Esempio n. 2
0
 private bool save()
 {
     SaveFileDialog dialog = new SaveFileDialog();
     dialog.Filter = "Arman level files (*.alvl)|*.alvl|All files (*.*)|*.*";
     dialog.Title = "Choose level file to save";
     dialog.FileName = data.Name + ".alvl";
     string fileName = String.Empty;
     if ((bool)dialog.ShowDialog())
         fileName = dialog.FileName;
     if (fileName != String.Empty)
     {
         dataLoader = new DataLoader(fileName);
         dataLoader.SaveData(data);
         changesSaved = true;
         return true;
     }
     return false;
 }
Esempio n. 3
0
 private bool load()
 {
     OpenFileDialog dialog = new OpenFileDialog();
     dialog.Filter = "Arman level files (*.alvl)|*.alvl|All files (*.*)|*.*";
     dialog.Title = "Choose level file to load";
     string fileName = String.Empty;
     if (dialog.ShowDialog().Value)
         fileName = dialog.FileName;
     if (fileName != String.Empty)
     {
         dataLoader = new DataLoader(fileName);
         data = dataLoader.ReadData(true);
         resizeWindow(data.XGameArea, data.YGameArea);
         refresh();
         this.Title = "Arman Level Editor - " + data.Name;
         changesSaved = true;
         enableControlsForLevel();
         activateDetectors.IsChecked = data.Objectives.ActivateDetectors;
         collectCoins.IsChecked = data.Objectives.CollectAllCoins;
         getHome.IsChecked = data.Objectives.GetHome;
         return true;
     }
     return false;
 }