/// <summary> /// Push the specified scene. /// </summary> /// <param name="scene">Scene.</param> public void Push(ISceneFileEntity scene) { // Add if empty if (_backHistory.Count <= 0) { _backHistory.Push(scene); _forwardHistory.Clear(); ClearStringCache(); Save(); return; } // Discard if the same scene var peek = _backHistory.Peek(); if (string.Equals(peek.Name, scene.Name)) { return; } // Add if not the same _backHistory.Push(scene); ClearStringCache(); _forwardHistory.Clear(); Save(); }
/// <summary> /// Opens the scene. /// </summary> /// <returns><c>true</c>, if scene was opened, <c>false</c> otherwise.</returns> /// <param name="entity">Entity.</param> public static bool OpenScene(ISceneFileEntity entity) { if (entity == null) { return(false); } return(OpenScene(entity.FullPath)); }
/// <summary> /// Opens the scene. /// </summary> /// <returns><c>true</c>, if scene was opened, <c>false</c> otherwise.</returns> /// <param name="entity">Entity.</param> public static bool OpenScene(ISceneFileEntity entity) { if (entity == null) return false; return OpenScene (entity.FullPath); }
/// <summary> /// Push the specified scene. /// </summary> /// <param name="scene">Scene.</param> public void Push(ISceneFileEntity scene) { // Add if empty if (_backHistory.Count <= 0) { _backHistory.Push (scene); _forwardHistory.Clear (); ClearStringCache (); Save (); return; } // Discard if the same scene var peek = _backHistory.Peek (); if (string.Equals (peek.Name, scene.Name)) { return; } // Add if not the same _backHistory.Push (scene); ClearStringCache (); _forwardHistory.Clear (); Save (); }