Пример #1
0
 public SceneBuilder(GraphicsDevice device,
                     EntityController entityController,
                     SkyboxBuilder skyboxBuilder,
                     LightsFactory lightsFactory,
                     OpaqueModelFactory opaqueModelFactory,
                     TransparentModelFactory transparentModelFactory,
                     ProjectorFactory projectorFactory,
                     AdditiveEmitterFactory additiveEmitterFactory,
                     AveragedEmitterFactory averagedEmitterFactory,
                     DynamicTextureFactory dynamicTextureFactory,
                     DebugInfoFactory debugInfoFactory,
                     WaypointFactory waypointFactory,
                     PipelineBuilder pipelineBuilder)
 {
     this.EntityController        = entityController;
     this.SkyboxBuilder           = skyboxBuilder;
     this.LightsFactory           = lightsFactory;
     this.OpaqueModelFactory      = opaqueModelFactory;
     this.TransparentModelFactory = transparentModelFactory;
     this.ProjectorFactory        = projectorFactory;
     this.AdditiveEmitterFactory  = additiveEmitterFactory;
     this.AveragedEmitterFactory  = averagedEmitterFactory;
     this.DynamicTextureFactory   = dynamicTextureFactory;
     this.DebugInfoFactory        = debugInfoFactory;
     this.WaypointFactory         = waypointFactory;
     this.PipelineBuilder         = pipelineBuilder;
 }
Пример #2
0
 public CreateMenu(DebugInfoFactory outLineFactory, WaypointFactory waypointFactory,
                   ProjectorFactory projectorFactory, ContentManager content, LightsController lightsController)
 {
     this.OutlineFactory   = outLineFactory;
     this.WaypointFactory  = waypointFactory;
     this.ProjectorFactory = projectorFactory;
     this.Texture          = content.Load <Texture2D>("Debug");
     this.LightsController = lightsController;
     this.State            = new UIState();
 }
Пример #3
0
 public static Func <double, double, Func <string, string> > MakerZipper(ProjectorFactory facX, ProjectorFactory facY) =>
 (x, y) => {
     if (!double.IsNaN(x))
     {
         return(facX.Make(x));
     }
     if (!double.IsNaN(y))
     {
         return(facY.Make(y));
     }
     return(facX.MakeDefault());
 };
Пример #4
0
 public static Func <double, double, Color?> ColorZipper(ProjectorFactory facX, ProjectorFactory facY) =>
 (x, y) => {
     if (!double.IsNaN(x))
     {
         return(facX.Project(x).HslToColor());
     }
     if (!double.IsNaN(y))
     {
         return(facY.Project(y).HslToColor());
     }
     return(null);
 };
Пример #5
0
 public static Func <double, double, string, string> RenderZipper(ProjectorFactory facX, ProjectorFactory facY) =>
 (x, y, tx) => {
     if (!double.IsNaN(x))
     {
         return(facX.Render(x, tx));
     }
     if (!double.IsNaN(y))
     {
         return(facY.Render(y, tx));
     }
     return(facX.Render(double.NaN, tx));
 };
Пример #6
0
        public void Test()
        {
            var bound   = (0, 5);
            var preset  = Presets.Fresh;
            var effects = new Effect[] { };
            var factory = ProjectorFactory.Build(bound, preset, effects);

            foreach (var i in Enumerable.Range(0, 5))
            {
                var dye = factory.Make(i);
                Console.WriteLine($"[{i}]: {dye("some")}");
            }
        }
Пример #7
0
        public Solution(IEventRepository eventRepository, ISnapshotRepository snapshotRepository)
        {
            var eventStore        = new EventStore.EventStore(eventRepository);
            var snapshotStore     = new SnapshotStore(snapshotRepository);
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton <SolutionContext>();
            serviceCollection.AddSingleton <ICommandBus>(new CommandBus(eventStore));
            serviceCollection.AddSingleton <IQueryBus>(new QueryBus());
            serviceCollection.AddSingleton <IEventBus>(new EventBus());
            serviceCollection.AddSingleton <IEventStore>(eventStore);
            serviceCollection.AddSingleton <ISnapshotStore>(snapshotStore);

            ServiceProvider = serviceCollection.BuildServiceProvider();
            ProjectorFactory.Init(EventStore);
        }
Пример #8
0
        public void TestFixtureSetUp()
        {
            var connectionString = ConfigurationManager.ConnectionStrings["eventstore"].ConnectionString;
            var url    = new MongoUrl(connectionString);
            var client = new MongoClient(url);

            _db = client.GetDatabase(url.DatabaseName);
            client.DropDatabase(url.DatabaseName);

            _identityConverter = new IdentityManager(new InMemoryCounterService());
            _identityConverter.RegisterIdentitiesFromAssembly(GetType().Assembly);
            var loggerFactory = Substitute.For <ILoggerFactory>();

            loggerFactory.Create(Arg.Any <Type>()).Returns(NullLogger.Instance);
            _eventStore = Substitute.For <IStoreEvents>();

            _factory = new ProjectorFactory(Substitute.For <IKernel>());
        }
Пример #9
0
 public async Task LoadProjection()
 {
     Projector = await ProjectorFactory.GetProjector <TProjector>(AggregateId);
 }
Пример #10
0
 public static Func <double, string, string> RenderMapper(ProjectorFactory facX) =>
 facX.Render;
Пример #11
0
 public static Func <double, Color?> ColorMapper(ProjectorFactory facX) =>
 x => double.IsNaN(x) ? null : (Color?)facX.Project(x).HslToColor();
Пример #12
0
 public static Func <double, Func <string, string> > MakerMapper(ProjectorFactory facX) =>
 x => double.IsNaN(x) ? facX.MakeDefault() : facX.Make(x);