コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="superMonoBehaviour"></param>
        /// <param name="storageName">Имя хранилища</param>
        /// <param name="fileName">Имя сохраняемого файла</param>
        /// <param name="fileName">расширение сохраняемого файла</param>
        /// <param name="serializerSettings">Настройки (де)сериализации данных</param>
        public DataStorage(SuperMonoBehaviour superMonoBehaviour,
                           string storageName,
                           string fileName,
                           string fileExtension,
                           IJsonConvertor <T> jsonConvertor)
            : base(superMonoBehaviour)
        {
            if (superMonoBehaviour is null)
            {
                throw new ArgumentNullException(nameof(superMonoBehaviour));
            }

            if (string.IsNullOrEmpty(storageName))
            {
                throw new ArgumentException($"{nameof(storageName)} не может быть пустым или иметь значение null",
                                            nameof(storageName));
            }

            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentException($"{nameof(fileName)} не может быть пустым или иметь значение null",
                                            nameof(fileName));
            }

            if (string.IsNullOrEmpty(fileExtension))
            {
                throw new ArgumentException($"{nameof(fileExtension)} не может быть пустым или иметь значение null",
                                            nameof(fileExtension));
            }

            Name               = storageName;
            FileName           = FileName;
            FileExtension      = fileExtension;
            this.jsonConvertor = jsonConvertor ?? throw new ArgumentNullException(nameof(jsonConvertor));
        }
コード例 #2
0
        public Synchronizer(SuperMonoBehaviour superMonoBehaviour, IModelInteraction <T> model, ReaderWriter <T> readerWriter)
            : base(superMonoBehaviour)
        {
            this.model        = model ?? throw new ArgumentNullException(nameof(model));
            this.readerWriter = readerWriter ?? throw new ArgumentNullException(nameof(readerWriter));

            ChooseDataInfo = superMonoBehaviour.CreateCoroutineContainer();
        }
コード例 #3
0
    public ColorSchemeGenerator(SuperMonoBehaviour superMonoBehaviour, ColorSchemeData colorSchemeData, Image backgroundImageToCamera)
    {
        this.superMonoBehaviour      = superMonoBehaviour != null ? superMonoBehaviour : throw new System.ArgumentNullException(nameof(superMonoBehaviour));
        this.colorSchemeData         = colorSchemeData != null ? colorSchemeData : throw new System.ArgumentNullException(nameof(colorSchemeData));
        this.backgroundImageToCamera = backgroundImageToCamera != null ? backgroundImageToCamera : throw new System.ArgumentNullException(nameof(backgroundImageToCamera));

        changeColorSchemeInfo = superMonoBehaviour.CreateCoroutineContainer();
    }
コード例 #4
0
    public RewardedAdLoader(SuperMonoBehaviour superMonoBehaviour, CommandQueueMainThreadExecutor commandQueueHandler)
    {
        this.commandQueueHandler = commandQueueHandler != null ? commandQueueHandler : throw new ArgumentNullException(nameof(commandQueueHandler));
        this.superMonoBehaviour  = superMonoBehaviour != null ? superMonoBehaviour : throw new ArgumentNullException(nameof(superMonoBehaviour));

        tryToReLoadAdInfo = superMonoBehaviour.CreateCoroutineContainer();
        CreateNewRewardedAd();
    }
コード例 #5
0
        public SafeReaderWriter(SuperMonoBehaviour superMonoBehaviour, DataStorage <T> dataStorage) : base(superMonoBehaviour)
        {
            if (dataStorage is null)
            {
                throw new ArgumentNullException(nameof(dataStorage));
            }

            readerWriterState = new AtomicReference <ReaderWriterState <T> >(new InitialState <T>(dataStorage));
        }
コード例 #6
0
 public LocalStorageCrypto(SuperMonoBehaviour superMonoBehaviour,
                           string fileName,
                           string fileExtension,
                           IJsonConvertor <T> jsonConvertor)
     : base(superMonoBehaviour,
            fileName,
            fileExtension,
            jsonConvertor)
 {
     jsonEncryption = new JsonEncryption(FileName, FileExtension);
 }
コード例 #7
0
 public GooglePlayStorage(SuperMonoBehaviour superMonoBehaviour,
                          string fileName,
                          string fileExtension,
                          IJsonConvertor <T> jsonConvertor)
     : base(superMonoBehaviour,
            "Облачное хранилище google play-я",
            fileName,
            fileExtension,
            jsonConvertor)
 {
     loadDataInfo = superMonoBehaviour.CreateCoroutineContainer();
 }
コード例 #8
0
        public DataAssetInitializer(SuperMonoBehaviour superMonoBehaviour, params DataStorage <TData>[] storages)
        {
            dataModel = new Model.DataModel <TData, TGetter, TSetter, TChangingNotifier>();

            ReaderWriter <TData>[] safeReaderWriters = storages
                                                       .Select(storage => new SafeReaderWriter <TData>(superMonoBehaviour, storage))
                                                       .ToArray();

            ReaderWriter <TData> readerWritersContainer = new DataReaderWritersContainer <TData>(superMonoBehaviour, safeReaderWriters);

            synchronizer = new Synchronizer <TData>(superMonoBehaviour, dataModel, readerWritersContainer);
        }
コード例 #9
0
 public LocalStorage(SuperMonoBehaviour superMonoBehaviour,
                     string fileName,
                     string fileExtension,
                     IJsonConvertor <T> jsonConvertor)
     : base(superMonoBehaviour,
            "Локальное хранилище",
            fileName,
            fileExtension,
            jsonConvertor)
 {
     filePath = FilePathGetter.GetFilePath(FileNameWithExtension);
     Debug.Log($"{Name}. Путь к файлу данных : {filePath}");
     deviceDataLoader = new DeviceDataLoader(superMonoBehaviour, filePath);
 }
コード例 #10
0
 public CloudDataStorage(SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
     loadDataInfo = this.superMonoBehaviour.CreateCoroutineContainer();
 }
コード例 #11
0
 public LocalDataStorage(SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
     filePath     = FilePathGetter.GetFilePath(DataModel.FileNameWithExtension);
     loadDataInfo = superMonoBehaviour.CreateCoroutineContainer();
 }
コード例 #12
0
 protected AnimationByScript(SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
     SetBaseDefaultAnimationExecutionParameters();
     SetCommandsOnSwitchingActiveStateGameObject();
 }
コード例 #13
0
 protected ReaderWriter(SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
 }
コード例 #14
0
 public AnimatorByScript(T animationByScript, SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
     this.Animation = animationByScript ?? throw new ArgumentNullException(nameof(animationByScript));
     animationInfo  = superMonoBehaviour.CreateCoroutineContainer();
     SetCommandsOnSwitchingActiveStateGameObject();
 }
コード例 #15
0
 public SuperMonoBehaviourContainer(SuperMonoBehaviour superMonoBehaviour)
 {
     this.superMonoBehaviour = superMonoBehaviour != null
         ? superMonoBehaviour
         : throw new ArgumentNullException(nameof(superMonoBehaviour));
 }
コード例 #16
0
 public DataStorageOld(SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
 }
コード例 #17
0
 public DataReaderWritersContainer(SuperMonoBehaviour superMonoBehaviour, params ReaderWriter <T>[] storages)
     : base(superMonoBehaviour)
 {
     this.storages = storages;
 }
コード例 #18
0
 public FadeAnimation(SuperMonoBehaviour superMonoBehaviour, ComponentWithColor componentWithColor) : base(superMonoBehaviour)
 {
     this.componentWithColor = componentWithColor != null ? componentWithColor : throw new ArgumentNullException(nameof(componentWithColor));
 }
コード例 #19
0
 public DeviceDataLoader(SuperMonoBehaviour superMonoBehaviour, string filePath) : base(superMonoBehaviour)
 {
     this.filePath = filePath;
     loadDataInfo  = superMonoBehaviour.CreateCoroutineContainer();
 }
コード例 #20
0
 protected BaseAnimationByScript(SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
     SetBaseDefaultAnimationCreatingParameters();
 }
コード例 #21
0
 public DataLoader(SuperMonoBehaviour superMonoBehaviour, params StorageDataReaderWriter[] storages) : base(superMonoBehaviour)
 {
     this.storages = storages;
 }
コード例 #22
0
 protected StorageDataReaderWriter(SuperMonoBehaviour superMonoBehaviour) : base(superMonoBehaviour)
 {
 }