Example #1
0
 // Use this for initialization
 void Start()
 {
     if(singleton == null)
     {
         singleton = this;
     }
     labelStyle.alignment = TextAnchor.MiddleCenter;
     labelStyle.fontSize = 20;
 }
Example #2
0
 public Engine(IFileResolver fileResolver, IGraphics graphics, IFontEngine fonts, ISounds sounds = null)
 {
     this.fileResolver = fileResolver;
     this.graphics     = graphics;
     this.fonts        = fonts;
     this.sounds       = sounds;
     if (sounds == null)
     {
         this.sounds = new NoSounds();
     }
     timeProvider    = new StopWatchTimeInfoProvider();
     input           = new BasicInput();
     textureManager  = new ResourceManager <Texture>();
     tileSetManager  = new ResourceManager <TileSet>();
     musicManager    = new ResourceManager <Music>();
     soundManager    = new ResourceManager <Sound>();
     eventManager    = new EventManager(this);
     entityManager   = new EntityManager(this);
     enemyManager    = new EnemyManager(this);
     campaignManager = new CampaignManager();
     currentScreen   = new NullScreen(this);
     mapScreen       = new MapScreen(this);
     loadScreen      = new LoadScreen(this);
     splashScreen    = new SplashScreen(this);
     titleScreen     = new TitleScreen(this);
     exitScreen      = new ExitScreen(this);
     testScreen      = new TestScreen(this);
     map             = MapFactory.MakeNullMap(this);
     camera          = new Camera(this, map);
     frameCounter    = new FrameCounter();
     loaders         = new List <ILoader>();
     loaders.Add(new XmlLoader(this));
     loaders.Add(new IniLoader(this));
     savers = new List <ISaver>();
     savers.Add(new IniSaver(this));
     savers.Add(new XmlSaver(this));
     nextEnemyTemplates = new List <string>();
 }
Example #3
0
        private void btn_exit_Click(object sender, RoutedEventArgs e)
        {
            bool allEmpty = true;

            foreach (UserTab ut in allTabs.GetTabs())
            {
                if (ut.amountOwing != 0)
                {
                    allEmpty = false;
                }
            }
            if (allEmpty)
            {
                GrayedOutWindow gw = new GrayedOutWindow();
                ExitScreen      es = new ExitScreen(this);

                es.textBlock.Text  = "You are about to return to the main menu. This will close all your open tabs.\nAre you sure you want to continue?";
                es.btn_yes.Content = "Yes";
                es.btn_yes.Width   = 160;
                es.btn_no.Content  = "No";
                es.btn_no.Width    = 160;
                es.btn_no.Margin   = new Thickness(210, 0, 0, 52);

                gw.Show();
                es.ShowDialog();
                gw.Close();
            }
            else
            {
                GrayedOutWindow gw = new GrayedOutWindow();
                ExitScreen      es = new ExitScreen(this);
                gw.Show();
                es.ShowDialog();
                gw.Close();
            }
        }
Example #4
0
 // Start is called before the first frame update
 void Start()
 {
     canvasObject.gameObject.SetActive(false);
     Instance = this;
 }
Example #5
0
 // This Method will use a jump tree allows the user to select from optioned provided in the text file.
 private void jumpTree(int userChoice)
 {
     RecipeMenu Recipe = new RecipeMenu();                                 // Allows us to move to the RecipeMenu class
     AlgorithmMenu Algorithm = new AlgorithmMenu();                        // Allows us to move to the AlgorithmMenu class
     ExitScreen Exit = new ExitScreen();                                   // Allows us to move to the Exit class
     switch (userChoice)
     {
         case 1:
             Recipe.displayScreen();
             break;
         case 2:
             Algorithm.displayScreen();
             break;
         case 3:
             Exit.exitScreen();
             break;
         default:
             Console.WriteLine("Something went wrong in the jumpTree");
             break;
     }
 }