/// <summary>
 /// Initializes the GamePlayScreen with a simulation already built.
 /// </summary>
 /// <param name="sim"></param>
 public GameplayScreen(TopLevelModel topLevel, Simulation sim)
     : base(topLevel)
 {
     base.TransitionOnTime = TimeSpan.FromSeconds(1.5);
       base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
       simulation = sim;
 }
        /// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        private LoadingScreen(TopLevelModel topLevel, bool loadingIsSlow, GameScreen[] screensToLoad)
            : base(topLevel)
        {
            this.loadingIsSlow = loadingIsSlow;
              this.screensToLoad = screensToLoad;

              base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
 public GameplayScreen(TopLevelModel topLevel, Level level, string levelName)
     : base(topLevel)
 {
     LevelName = levelName;
       this.level = level;
       base.TransitionOnTime = TimeSpan.FromSeconds(1.5);
       base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
 }
        public GameEditorScreen(TopLevelModel topLevel, string levelName)
            : base(topLevel)
        {
            base.TransitionOnTime = TimeSpan.FromSeconds(1.5);
              base.TransitionOffTime = TimeSpan.FromSeconds(0.5);

              LevelName = levelName;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="topLevel"></param>
        /// <param name="completedLevel"></param>
        /// <param name="simulation"></param>
        public CompletionScreen(TopLevelModel topLevel, LevelScoreData completedLevel, Simulation simulation)
            : base(topLevel)
        {
            levelData = completedLevel;
              this.simulation = simulation;

              base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
              base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
        }
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(TopLevelModel topLevel, bool loadingIsSlow, params GameScreen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
              foreach (GameScreen screen in topLevel.Scene)
            screen.ExitScreen();

              // Create and activate the loading screen.
              topLevel.Scene.AddScreen(new LoadingScreen(topLevel, loadingIsSlow, screensToLoad));
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="topLevel"></param>
 /// <param name="editableLevel"></param>
 /// <param name="levelName"></param>
 public PauseMenuScreen(TopLevelModel topLevel, EditableLevel editableLevel, string levelName)
     : base(topLevel)
 {
     base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
       base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
       EditorMode = true;
       custom = editableLevel.Custom;
       this.restartable = editableLevel;
       LevelName = levelName;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="topLevel"></param>
 /// <param name="simulation"></param>
 /// <param name="levelName"></param>
 public PauseMenuScreen(TopLevelModel topLevel, Simulation simulation, string levelName)
     : base(topLevel)
 {
     base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
       base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
       EditorMode = false;
       custom = false;
       this.restartable = simulation;
       LevelName = levelName;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="completed"></param>
        /// <param name="levelScore"></param>
        /// <param name="levelNumber"></param>
        /// <param name="completionTime"></param>
        public LevelStatusScreen(TopLevelModel topLevel, PuzzlePathDimension.LevelSelectScreen.LevelInfo levelInfo)
            : base(topLevel)
        {
            base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
              base.TransitionOffTime = TimeSpan.FromSeconds(0.5);

              Completed = levelInfo.Completed;
              LevelScore = levelInfo.LevelScore;
              LevelName = levelInfo.LevelName;
              CompletionTime = levelInfo.CompletionTime;
              LevelFileName = levelInfo.FileName;
        }
        /// <summary>
        /// Constructor lets the caller specify whether to include any
        /// of the three Buttons available, and to allows the caller
        /// to specify the text of the button.
        /// </summary>
        public MessageBoxScreen(TopLevelModel topLevel, string message, string leftButtonText, string middleButtonText, string rightButtonText)
            : base(topLevel)
        {
            this.title = message;

              messageBoxTemplate = new MessageBoxTemplate(message);
              LeftButtonText = leftButtonText;
              MiddleButtonText = middleButtonText;
              RightButtonText = rightButtonText;

              base.IsPopup = true;
              base.TransitionOnTime = TimeSpan.FromSeconds(0.2);
              base.TransitionOffTime = TimeSpan.FromSeconds(0.2);
        }
        /// <summary>
        /// Constructor automatically includes a Left button to Cancel
        /// and a Right button to Confirm the message. 
        /// </summary>
        public MessageBoxScreen(TopLevelModel topLevel, string message)
            : base(topLevel)
        {
            this.title = message; // Added. - Jorenz

            messageBoxTemplate = new MessageBoxTemplate(message);
            LeftButtonText = "Cancel";
            MiddleButtonText = null;
            RightButtonText = "Confirm";

            base.IsPopup = true;
            base.TransitionOnTime = TimeSpan.FromSeconds(0.2);
            base.TransitionOffTime = TimeSpan.FromSeconds(0.2);
        }
        /// <summary>
        /// Contructor
        /// Read an xml file and obtain information for each level in the xml file.
        /// </summary>
        public LevelSelectScreen(TopLevelModel topLevel, ContentManager Content)
            : base(topLevel)
        {
            // Create a list of all the levels and obtain the user progress for all existing levels.
              levelSet = new List<LevelInfo>();

              string levelListFile = Configuration.UserDataPath + Path.DirectorySeparatorChar + "levellist.xml";

              LevelGroup levels = LevelGroup.Load(levelListFile);
              SerializableDictionary<string, LevelStatus> progressInfo = base.Profile.Progress;

              // Go through the user progress data and display the correct information for each level.
              foreach (LevelEntry entry in levels.Entries) {
            LevelInfo info = new LevelInfo();

            info.FileName = entry.FullPath;
            info.LevelName = entry.Id;

            if (progressInfo.ContainsKey(info.LevelName)) {
              info.CompletionTime = progressInfo[info.LevelName].FastestTimeInSeconds;
              info.Completed = progressInfo[info.LevelName].Completed;
              info.LevelScore = progressInfo[info.LevelName].Score;
            } else {
              info.CompletionTime = 3600;
              info.Completed = false;
              info.LevelScore = 0;
            }
            levelSet.Add(info);
              }

              // Add the custom level's entry at the end of the list.
              AddCustomLevel();

              base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
              base.TransitionOffTime = TimeSpan.FromSeconds(0.5);

              items = menuTemplate.Items;
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 public BackgroundScreen(TopLevelModel topLevel)
     : base(topLevel)
 {
     base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
       base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
 }
        /// <summary>
        /// Constructor that includes a message to be displayed and Boolean to determine if more platforms can be added
        /// </summary>
        public ToolboxScreen(TopLevelModel topLevel, EditableLevel level, string message, bool limitReached)
            : base(topLevel)
        {
            this._message = message;
              _cantAdd = limitReached;
              //initializa the position of regular platforms
              _platforms = new List<Rectangle>();
              editableLevel = level;

              if (level.TypesAllowed.Contains("R")) {
            if (level.TypesAllowed.Contains("H")) {
              _platforms.Add(new Rectangle(100, 130, 100, 25));
              _platforms.Add(new Rectangle(300, 130, 150, 25));
              _platforms.Add(new Rectangle(500, 130, 200, 25));
            }
            if (level.TypesAllowed.Contains("V")) {
              _platforms.Add(new Rectangle(100, 210, 25, 100));
              _platforms.Add(new Rectangle(300, 210, 25, 150));
              _platforms.Add(new Rectangle(500, 210, 25, 200));
            }
              }
              //Initializes the position of breakable platforms.
              _breakablePlatforms = new List<Rectangle>();
              if (level.TypesAllowed.Contains("B")) {
            if (level.TypesAllowed.Contains("H")) {
              _breakablePlatforms.Add(new Rectangle(100, 160, 100, 25));
              _breakablePlatforms.Add(new Rectangle(300, 160, 150, 25));
              _breakablePlatforms.Add(new Rectangle(500, 160, 200, 25));
            }
            if (level.TypesAllowed.Contains("V")) {
              _breakablePlatforms.Add(new Rectangle(175, 210, 25, 100));
              _breakablePlatforms.Add(new Rectangle(425, 210, 25, 150));
              _breakablePlatforms.Add(new Rectangle(675, 210, 25, 200));
            }
              }

              base.IsPopup = true;
              base.TransitionOnTime = TimeSpan.FromSeconds(0.2);
              base.TransitionOffTime = TimeSpan.FromSeconds(0.2);
        }
 public GameScreen(TopLevelModel topLevel)
 {
     TopLevel = topLevel;
 }
 /// <summary>
 /// Contructor
 /// </summary>
 public HowToPlayScreen4(TopLevelModel topLevel)
     : base(topLevel)
 {
     base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
       base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public MainMenuScreen(TopLevelModel topLevel)
     : base(topLevel)
 {
     base.TransitionOnTime = TimeSpan.FromSeconds(0.5);
       base.TransitionOffTime = TimeSpan.FromSeconds(0.5);
 }