Ejemplo n.º 1
0
        static Session CreateNewSession(FileLocationSettings fileLocations)
        {
            Session session;

            Debug.Log($"{TuxLog.Prefix} Previous Session file not found, creating new");
            session = new Session(fileLocations);
            return(session);
        }
Ejemplo n.º 2
0
 public Session(FileLocationSettings fileLocations)
 {
     if (fileLocations == null)
     {
         throw new NullReferenceException("File Locations Null when creating session");
     }
     FileLocations = fileLocations;
 }
Ejemplo n.º 3
0
        public static Session LoadSessionData(FileLocationSettings fileLocations)
        {
            string  filePath = fileLocations.LastSessionSaveFilePath;
            Session session;

            if (File.Exists(filePath))
            {
                string dataAsJason = File.ReadAllText(filePath);
                session = JsonUtility.FromJson <Session>(dataAsJason);
                session.FileLocations = fileLocations;
                if (!session.ValidSelf())
                {
                    Debug.LogWarning($"{TuxLog.Prefix} Loaded Session Not valid, creating new");
                    CreateNewSession(fileLocations);
                }
            }
            else
            {
                session = CreateNewSession(fileLocations);
            }
            session.Enable();
            return(session);
        }
Ejemplo n.º 4
0
 public DebugSession(FileLocationSettings fileLocations) : base(fileLocations)
 {
     OutputFile             = OutputFile.DebugFile(fileLocations);
     SelectedDesignFilePath = "";
     BlockOrderChosenIndex  = 0;
 }