protected override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
        {
            base.Deserialize(reader, assetStore);

            LinearVelocity  = reader.ReadDouble("LinearVelocity");
            AngularVelocity = reader.ReadDouble("AngularVelocity");
        }
        protected internal override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
        {
            base.Deserialize(reader, assetStore);

            Sound     = reader.IsNull("Sound") ? null : assetStore.GetAsset <ISound>(reader.ReadAssetId("Sound"));
            IsPlaying = reader.ReadBool("IsPlaying");
        }
Exemplo n.º 3
0
        public GraphQLUrlGenerator(IOptions <MyUrlsOptions> urlsOptions, IAssetStore assetStore, bool allowAssetSourceUrl)
        {
            this.assetStore  = assetStore;
            this.urlsOptions = urlsOptions.Value;

            CanGenerateAssetSourceUrl = allowAssetSourceUrl;
        }
Exemplo n.º 4
0
 protected internal override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
 {
     base.Deserialize(reader, assetStore);
     Dimension    = reader.ReadVector2("Dimension");
     Color        = reader.ReadColor("Color");
     FillInterior = reader.ReadBool("FillInterior");
 }
Exemplo n.º 5
0
 protected internal override void Serialize(IComponentDataWriter writer, IAssetStore assetStore)
 {
     base.Serialize(writer, assetStore);
     writer.WriteVector3("Translation", Translation);
     writer.WriteVector3("Rotation", Rotation);
     writer.WriteVector3("Scale", Scale);
 }
Exemplo n.º 6
0
 protected internal override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
 {
     base.Deserialize(reader, assetStore);
     Sprite = reader.IsNull("Sprite")
         ? null
         : assetStore.GetAsset <Sprite>(reader.ReadAssetId("Sprite"));
 }
Exemplo n.º 7
0
        public RestoreGrain(
            IAssetStore assetStore,
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IGrainFactory grainFactory,
            IEnumerable <BackupHandler> handlers,
            ISemanticLog log,
            IStreamNameResolver streamNameResolver,
            IStore <string> store)
        {
            Guard.NotNull(assetStore, nameof(assetStore));
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(grainFactory, nameof(grainFactory));
            Guard.NotNull(handlers, nameof(handlers));
            Guard.NotNull(store, nameof(store));
            Guard.NotNull(streamNameResolver, nameof(streamNameResolver));
            Guard.NotNull(log, nameof(log));

            this.assetStore            = assetStore;
            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.grainFactory       = grainFactory;
            this.handlers           = handlers;
            this.store              = store;
            this.streamNameResolver = streamNameResolver;
            this.log = log;
        }
Exemplo n.º 8
0
 protected internal override void Serialize(IComponentDataWriter writer, IAssetStore assetStore)
 {
     base.Serialize(writer, assetStore);
     writer.WriteString("Text", Text);
     writer.WriteDouble("FontSize", FontSize.Points);
     writer.WriteColor("Color", Color);
 }
Exemplo n.º 9
0
        public BackupGrain(
            IAssetStore assetStore,
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IJsonSerializer serializer,
            IServiceProvider serviceProvider,
            ISemanticLog log,
            IGrainState <BackupState> state)
        {
            Guard.NotNull(assetStore, nameof(assetStore));
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(serviceProvider, nameof(serviceProvider));
            Guard.NotNull(serializer, nameof(serializer));
            Guard.NotNull(state, nameof(state));
            Guard.NotNull(log, nameof(log));

            this.assetStore            = assetStore;
            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.serializer         = serializer;
            this.serviceProvider    = serviceProvider;
            this.state              = state;
            this.log = log;
        }
Exemplo n.º 10
0
        public BackupGrain(
            IAssetStore assetStore,
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            IEnumerable <BackupHandler> handlers,
            IJsonSerializer serializer,
            ISemanticLog log,
            IStore <Guid> store)
        {
            Guard.NotNull(assetStore, nameof(assetStore));
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(handlers, nameof(handlers));
            Guard.NotNull(serializer, nameof(serializer));
            Guard.NotNull(store, nameof(store));
            Guard.NotNull(log, nameof(log));

            this.assetStore            = assetStore;
            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.handlers           = handlers;
            this.serializer         = serializer;
            this.store              = store;
            this.log = log;
        }
Exemplo n.º 11
0
        protected override void Serialize(IComponentDataWriter writer, IAssetStore assetStore)
        {
            base.Serialize(writer, assetStore);

            writer.WriteDouble("LinearVelocity", LinearVelocity);
            writer.WriteDouble("AngularVelocity", AngularVelocity);
        }
Exemplo n.º 12
0
        public DefaultAppImageStore(IAssetStore assetStore,
                                    IOptions <AssetOptions> options)
        {
            this.assetStore = assetStore;

            this.options = options.Value;
        }
Exemplo n.º 13
0
 /// <inheritdoc />
 protected internal override void Serialize(IComponentDataWriter writer, IAssetStore assetStore)
 {
     base.Serialize(writer, assetStore);
     writer.WriteBool("Visible", Visible);
     writer.WriteString("SortingLayerName", SortingLayerName);
     writer.WriteInt("OrderInLayer", OrderInLayer);
 }
Exemplo n.º 14
0
        public static async Task DownloadAsync(this IAssetStore assetStore, DirectoryInfo directory)
        {
            if (directory.Exists)
            {
                directory.Delete(true);
            }

            directory.Create();

            using (var fileStream = new FileStream(
                       Path.Combine(directory.FullName, ArchiveFile),
                       FileMode.Create,
                       FileAccess.ReadWrite,
                       FileShare.None,
                       4096,
                       FileOptions.DeleteOnClose))
            {
                try
                {
                    await assetStore.DownloadAsync(directory.Name, 0, string.Empty, fileStream);

                    fileStream.Position = 0;

                    using (var zipArchive = new ZipArchive(fileStream, ZipArchiveMode.Read, true))
                    {
                        zipArchive.ExtractToDirectory(directory.FullName);
                    }
                }
                catch (AssetNotFoundException)
                {
                    return;
                }
            }
        }
Exemplo n.º 15
0
 protected internal override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
 {
     base.Deserialize(reader, assetStore);
     Translation = reader.ReadVector3("Translation");
     Rotation    = reader.ReadVector3("Rotation");
     Scale       = reader.ReadVector3("Scale");
 }
Exemplo n.º 16
0
 protected internal override void Serialize(IComponentDataWriter writer, IAssetStore assetStore)
 {
     base.Serialize(writer, assetStore);
     writer.WriteVector2("Dimension", Dimension);
     writer.WriteColor("Color", Color);
     writer.WriteBool("FillInterior", FillInterior);
 }
Exemplo n.º 17
0
        public BackupGrain(
            IAssetStore assetStore,
            IBackupArchiveLocation backupArchiveLocation,
            IClock clock,
            IEventStore eventStore,
            IEventDataFormatter eventDataFormatter,
            ISemanticLog log,
            IStore <Guid> store)
        {
            Guard.NotNull(assetStore, nameof(assetStore));
            Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation));
            Guard.NotNull(clock, nameof(clock));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter));
            Guard.NotNull(store, nameof(store));
            Guard.NotNull(log, nameof(log));

            this.assetStore            = assetStore;
            this.backupArchiveLocation = backupArchiveLocation;
            this.clock              = clock;
            this.eventStore         = eventStore;
            this.eventDataFormatter = eventDataFormatter;
            this.store              = store;
            this.log = log;
        }
Exemplo n.º 18
0
 /// <inheritdoc />
 protected internal override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
 {
     base.Deserialize(reader, assetStore);
     Visible          = reader.ReadBool("Visible");
     SortingLayerName = reader.ReadString("SortingLayerName") ??
                        throw new InvalidOperationException("SortingLayerName cannot be null.");
     OrderInLayer = reader.ReadInt("OrderInLayer");
 }
Exemplo n.º 19
0
 protected internal override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
 {
     base.Deserialize(reader, assetStore);
     Text = reader.ReadString("Text") ??
            throw new InvalidOperationException("Text cannot be null.");
     FontSize = FontSize.FromPoints(reader.ReadDouble("FontSize"));
     Color    = reader.ReadColor("Color");
 }
Exemplo n.º 20
0
 public SceneSerializer(ISceneFactory sceneFactory, ISceneBehaviorFactoryProvider sceneBehaviorFactoryProvider,
                        IComponentFactoryProvider componentFactoryProvider, IAssetStore assetStore)
 {
     _sceneFactory = sceneFactory;
     _sceneBehaviorFactoryProvider = sceneBehaviorFactoryProvider;
     _componentFactoryProvider     = componentFactoryProvider;
     _assetStore = assetStore;
 }
Exemplo n.º 21
0
 public RenderingSystemIntegrationTestsSut(IAssetStore assetStore, IDebugRenderer debugRenderer, IRenderingBackend renderingBackend,
                                           IRenderingSystem renderingSystem)
 {
     AssetStore       = assetStore;
     DebugRenderer    = debugRenderer;
     RenderingBackend = renderingBackend;
     RenderingSystem  = renderingSystem;
 }
            protected internal override void Serialize(IComponentDataWriter writer, IAssetStore assetStore)
            {
                base.Serialize(writer, assetStore);

                writer.WriteInt("IntProperty", IntProperty);
                writer.WriteDouble("DoubleProperty", DoubleProperty);
                writer.WriteString("StringProperty", StringProperty);
            }
Exemplo n.º 23
0
 public AssetRepository(IAssetStore store,
                        ICacheService cacheService,
                        IUserIdAccesor userIdAccesor,
                        ICacheOptions options)
     : base(store, cacheService, options)
 {
     _userIdAccesor = userIdAccesor;
 }
Exemplo n.º 24
0
 public void SetUp()
 {
     _assetStore   = Substitute.For <IAssetStore>();
     _sceneLoader  = Substitute.For <ISceneLoader>();
     _sceneFactory = Substitute.For <ISceneFactory>();
     _sceneBehaviorFactoryProvider = Substitute.For <ISceneBehaviorFactoryProvider>();
     _sceneBehaviorFactoryProvider.Get(Arg.Any <string>()).ThrowsForAnyArgs(new InvalidOperationException("Missing substitute configuration."));
     _sceneManager = new SceneManager(_assetStore, _sceneLoader, _sceneFactory, _sceneBehaviorFactoryProvider);
 }
Exemplo n.º 25
0
 public SandboxSystem(IAssetStore assetStore, IEngineManager engineManager, ISceneLoader sceneLoader, ISceneManager sceneManager,
                      IAudioBackend audioBackend)
 {
     _assetStore    = assetStore;
     _engineManager = engineManager;
     _sceneLoader   = sceneLoader;
     _sceneManager  = sceneManager;
     _audioPlayer   = audioBackend.AudioPlayer;
 }
Exemplo n.º 26
0
        public DefaultAssetFileStore(
            IAssetStore assetStore,
            IAssetRepository assetRepository,
            IOptions <AssetOptions> options)
        {
            this.assetStore      = assetStore;
            this.assetRepository = assetRepository;

            this.options = options.Value;
        }
Exemplo n.º 27
0
        public SceneManager(IAssetStore assetStore, ISceneLoader sceneLoader, ISceneFactory sceneFactory,
                            ISceneBehaviorFactoryProvider sceneBehaviorFactoryProvider)
        {
            _assetStore   = assetStore;
            _sceneLoader  = sceneLoader;
            _sceneFactory = sceneFactory;
            _sceneBehaviorFactoryProvider = sceneBehaviorFactoryProvider;

            _sceneLoadRequest.MarkAsHandled();
        }
Exemplo n.º 28
0
        protected override void Serialize(IComponentDataWriter writer, IAssetStore assetStore)
        {
            base.Serialize(writer, assetStore);

            writer.WriteDouble("Velocity", Velocity);
            writer.WriteDouble("X", X);
            writer.WriteDouble("Y", Y);
            writer.WriteDouble("Width", Width);
            writer.WriteDouble("Height", Height);
        }
Exemplo n.º 29
0
        protected override void Deserialize(IComponentDataReader reader, IAssetStore assetStore)
        {
            base.Deserialize(reader, assetStore);

            Velocity = reader.ReadDouble("Velocity");
            X        = reader.ReadDouble("X");
            Y        = reader.ReadDouble("Y");
            Width    = reader.ReadDouble("Width");
            Height   = reader.ReadDouble("Height");
        }
Exemplo n.º 30
0
        public BackupAssets(IStore <Guid> store, IAssetStore assetStore, ITagService tagService)
            : base(store)
        {
            Guard.NotNull(assetStore);
            Guard.NotNull(tagService);

            this.assetStore = assetStore;

            this.tagService = tagService;
        }