Exemple #1
0
        public void SetUp()
        {
            _systemContainer = Substitute.For <ISystemContainer>();

            _entityEngine = Substitute.For <IEntityEngine>();
            _systemContainer.EntityEngine.Returns(_entityEngine);
            _mutableEntities = new List <IEntity>();
            _entityEngine.MutableEntities.Returns(_mutableEntities);

            _mapSystem = Substitute.For <IMapSystem>();
            _systemContainer.MapSystem.Returns(_mapSystem);
            _mapCollection = new Atlas();
            _mapSystem.MapCollection.Returns(_mapCollection);

            _messageSystem = Substitute.For <IMessageSystem>();
            _systemContainer.MessageSystem.Returns(_messageSystem);
            _messages = new List <Message>();
            _messageSystem.AllMessages.Returns(_messages);

            _timeSystem = Substitute.For <ITimeSystem>();
            _systemContainer.TimeSystem.Returns(_timeSystem);
            _currentTime = 0;
            _timeSystem.CurrentTime.Returns(_currentTime);

            _worldGenerator = Substitute.For <IWorldGenerator>();

            _saveSystem = new SaveSystem(_systemContainer, _worldGenerator);
        }
        public HighScoresActivity(IActivitySystem activitySystem, ISaveSystem saveSystem) : base(activitySystem.DefaultPosition, activitySystem.DefaultPadding, activitySystem, "", true)
        {
            _saveSystem = saveSystem;

            var highScoreText = GetHighScoreText();

            Text = highScoreText;
        }
        public HighScoresActivity(Rectangle position, Padding padding, IActivitySystem activitySystem, ISaveSystem saveSystem) : base(position, padding, activitySystem, "", true)
        {
            _saveSystem = saveSystem;

            var highScoreText = GetHighScoreText();

            Text = highScoreText;
        }
Exemple #4
0
 private void Start()
 {
     _saveSystem = new BinarySaveSystem();
     CreateStartData();
     Subscribe();
     Display(_myData);
     CorrectUi(_myData);
 }
Exemple #5
0
        void Awake()
        {
            _singletonComponent = new SingletonComposition <UserManager>(Instance,
                                                                         () => Instance = this,
                                                                         () => Destroy(this.gameObject));

            string fileName = $"{Application.persistentDataPath}/playerData_{gamePrefsName}.dat";

            _fileSaveSystem = new FileSaveSystem(fileName);
        }
    public void SaveMaze()
    {
        string mazeSaveFolderPath = SaveFolderPathFromInputField.GetComponent <InputField>().text;

        saveSystem = new SaveSystemFactory().CreateSaveSystemForMazeSaving(defaultSaveFolderPath,
                                                                           planeBuilder,
                                                                           mazeSaveFolderPath,
                                                                           this);

        saveSystem.Save();
    }
Exemple #7
0
        void Awake()
        {
            if (!Instance)
            {
                Instance = this;
            }
            else
            {
                Destroy(this.gameObject);
            }

            string fileName = $"{Application.persistentDataPath}/playerData_{gamePrefsName}.dat";

            fileSaveSystem = new FileSaveSystem(fileName);
        }
    public void SaveMazeMetric(IMazeMetricCollector mazeMetricCollector)
    {
        string currentMazeDirectory;

        try
        {
            currentMazeDirectory = transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeDirectionFolder() + "/MazeMetric/" + transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeNameWithoutExtensions() + "_MazeMetric.txt";
        }
        catch (System.IndexOutOfRangeException)
        {
            currentMazeDirectory = string.Empty;
        }

        saveSystem = new SaveSystemFactory().CreateSaveSystemForMazeMetric(
            currentMazeDirectory,
            defaultSaveFolderPath,
            mazeMetricCollector);

        saveSystem.Save();
    }
    public void SaveMetricForPathFindProcess(IPathFindProcessMetricCollector pathFindProcessMetric, EPathFindAlgorithms pathFindAlgorithms)
    {
        string currentMazeDirectory;

        try
        {
            currentMazeDirectory = transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeDirectionFolder() + "/PathFindMetric/" + transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeNameWithoutExtensions() + "_" + pathFindAlgorithms.ToString() + "_PathFindMetric.txt";
        }
        catch (System.IndexOutOfRangeException)
        {
            currentMazeDirectory = string.Empty;
        }

        saveSystem = new SaveSystemFactory().CreateSaveSystemForPathFindProcessMetric(
            currentMazeDirectory,
            defaultSaveFolderPath,
            pathFindProcessMetric);

        saveSystem.Save();
    }
    public void SaveMarkForCurrentMaze()
    {
        string currentMazeDirectory;

        try
        {
            currentMazeDirectory = transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeDirectionFolder() + "/PlayerMarks/" + transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeNameWithoutExtensions() + "_PlayerMark.txt";
        }
        catch (System.IndexOutOfRangeException)
        {
            currentMazeDirectory = string.Empty;
        }

        Debug.Log(currentMazeDirectory);

        saveSystem = new SaveSystemFactory().CreateSaveSystemForMazeMark(
            currentMazeDirectory,
            defaultSaveFolderPath,
            markingDropdownList);

        saveSystem.Save();
        transform.GetComponent <LoadSystemBoundary>().LoadMaze();
    }