コード例 #1
0
ファイル: SpriteRenderable.cs プロジェクト: XinliZ/MonoEngine
        public override void Draw(IRenderService renderService, GameTime gameTime)
        {
            if (frame >= repeatX * repeatY) frame = 0;

            int x = frame % this.repeatX;
            int y = frame / this.repeatX;
            var sourceRectangle = new Rectangle(x * this.frameWidth, y * this.frameHeight, this.frameWidth, this.frameHeight);
            renderService.SpriteBatch.Draw(texture, origin, sourceRectangle, Color.White);
        }
コード例 #2
0
        public static BlobAssetReference <Collider> Create(IRenderService renderService)
        {
            NativeArray <float3> vertices = new NativeArray <float3>(
                renderService.GetVerticesArrayFloat3(),
                Allocator.TempJob
                );

            NativeArray <int3> triangles = new NativeArray <int3>(
                renderService.GetTrianglesArrayInt3(),
                Allocator.TempJob
                );

            BlobAssetReference <Collider> collider = Unity.Physics.MeshCollider.Create(vertices, triangles);

            triangles.Dispose();
            vertices.Dispose();

            return(collider);
        }
コード例 #3
0
        public MockLiveDataService(IRenderService renderService)
        {
            var images = new List <string>
            {
                "https://s3.envato.com/files/131529625/15_Confetti_backgrounds%20-screen/Confetti_background-11.jpg",
                "https://tse2.mm.bing.net/th?id=OIP.dqMe78yE0C3cFnVoGQa_aQHaFj&pid=Api",
                "http://3.bp.blogspot.com/-xLgRRD58ifc/U7K0D1XEWqI/AAAAAAAAOEs/_RQEMUnV2A0/s1600/Desktop+Background+wallpapers+(23).jpg"
            };

            ImageRender = Observable.Interval(TimeSpan.FromSeconds(1)).StartWith(0)
                          .Select(_ => GetRenderStatus(renderService)).Select(
                renderDataModel => new RenderDataModel
            {
                RenderName       = renderDataModel.RenderName,
                IsRendering      = renderDataModel.IsRendering,
                PercentComplete  = _random.Next(1, 100),
                ImageRelativeUrl = "http://localhost:59248/imgrend"                   // images[_random.Next(0, images.Count)]
            });
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BridgeLog" /> class.
        /// </summary>
        /// <param name="variableService">The variable service.</param>
        /// <param name="resourceService">The resource service.</param>
        public BridgeLog(IVariableService variableService, IResourceService resourceService, IRenderService renderService)
            : base(variableService, resourceService)
        {
            if (variableService == null)
            {
                throw new ArgumentNullException(nameof(variableService));
            }

            if (resourceService == null)
            {
                throw new ArgumentNullException(nameof(resourceService));
            }

            _renderService   = renderService;
            _resourceService = resourceService;
            _resourceService.PreloadResource <Sprite>("bridgelog");

            CollisionBox = new BoundingBox(-8.0, -8.0, 8.0, 8.0);
            Options     |= EntityOptions.Collidable;
            SolidType    = SolidType.JumpThrough;
        }
コード例 #5
0
        public void Test_Create_HexMeshCollider()
        {
            // Set
            Vector3 vertex1 = new Vector3(0f, 0f, 0f);
            Vector3 vertex2 = new Vector3(0f, 0f, 2f);
            Vector3 vertex3 = new Vector3(2f, 0f, 0f);

            float3[] triangleVerticesFloat3 = new float3[] { vertex1, vertex2, vertex3 };
            int3[]   trianglesArrayInt3     = new int3[] { new int3(0, 1, 2) };

            IRenderService renderService = Substitute.For <IRenderService>();

            renderService.GetVerticesArrayFloat3().Returns(triangleVerticesFloat3);
            renderService.GetTrianglesArrayInt3().Returns(trianglesArrayInt3);

            // Action
            BlobAssetReference <Collider> collider = HexMeshCollider.Create(renderService);

            // Assertion
            Assert.That(collider, Is.Not.Null);
        }
 private FundingSummaryReport NewReport(
     ILogger logger = null,
     IStreamableKeyValuePersistenceService streamableKeyValuePersistenceService = null,
     IDateTimeProvider dateTimeProvider = null,
     IFundingSummaryReportModelBuilder fundingSummaryReportModelBuilder = null,
     IExcelService excelService = null,
     IRenderService <IFundingSummaryReport> fundingSummaryReportRenderService     = null,
     IPeriodisedValuesLookupProviderService periodisedValuesLookupProviderService = null,
     IFCSProviderService fcsProviderService = null,
     IPersistReportData persisteReportData  = null)
 {
     return(new FundingSummaryReport(
                logger,
                streamableKeyValuePersistenceService,
                dateTimeProvider,
                fundingSummaryReportModelBuilder,
                excelService,
                fundingSummaryReportRenderService,
                periodisedValuesLookupProviderService,
                fcsProviderService,
                persisteReportData));
 }
 public FundingSummaryReport(
     ILogger logger,
     IStreamableKeyValuePersistenceService streamableKeyValuePersistenceService,
     IDateTimeProvider dateTimeProvider,
     IFundingSummaryReportModelBuilder modelBuilder,
     IExcelService excelService,
     IRenderService <IFundingSummaryReport> fundingSummaryReportRenderService,
     IPeriodisedValuesLookupProviderService periodisedValuesLookupProvider,
     IFCSProviderService fcsProviderService,
     IPersistReportData persistReportData)
     : base(
         dateTimeProvider,
         streamableKeyValuePersistenceService,
         logger)
 {
     _modelBuilder = modelBuilder;
     _excelService = excelService;
     _fundingSummaryReportRenderService = fundingSummaryReportRenderService;
     _periodisedValuesLookupProvider    = periodisedValuesLookupProvider;
     _fcsProviderService = fcsProviderService;
     _persistReportData  = persistReportData;
 }
コード例 #8
0
ファイル: GameObject.cs プロジェクト: XinliZ/MonoEngine
 public abstract void Draw(IRenderService renderService, GameTime gameTime);
コード例 #9
0
 public LinkService(DatabaseContext context, IRenderService renderService)
 {
     _context       = context;
     _renderService = renderService;
 }
コード例 #10
0
ファイル: Player.cs プロジェクト: stephaneclotilde/spikeball
        /// <summary>
        /// Initializes a new instance of the <see cref="Player" /> class.
        /// </summary>
        /// <param name="resourceService">The resource service.</param>
        /// <param name="renderService">The render service.</param>
        /// <param name="varService">The variable service.</param>
        /// <param name="inputService">The input service.</param>
        /// <param name="entityService">The entity service.</param>
        /// <param name="audioService">The audio service.</param>
        /// <param name="collisionService">The collision service.</param>
        public Player(
            IResourceService resourceService,
            IRenderService renderService,
            IVariableService varService,
            IInputService inputService,
            IEntityService entityService,
            IAudioService audioService,
            ICollisionService collisionService)
            : base(varService, resourceService)
        {
            if (resourceService == null)
            {
                throw new ArgumentNullException(nameof(resourceService));
            }

            if (renderService == null)
            {
                throw new ArgumentNullException(nameof(renderService));
            }

            if (varService == null)
            {
                throw new ArgumentNullException(nameof(varService));
            }

            if (inputService == null)
            {
                throw new ArgumentNullException(nameof(inputService));
            }

            if (entityService == null)
            {
                throw new ArgumentNullException(nameof(entityService));
            }

            if (audioService == null)
            {
                throw new ArgumentNullException(nameof(audioService));
            }

            if (collisionService == null)
            {
                throw new ArgumentNullException(nameof(collisionService));
            }

            _entityService    = entityService;
            _varService       = varService;
            _renderService    = renderService;
            _inputService     = inputService;
            _audioService     = audioService;
            _collisionService = collisionService;
            _resourceService  = resourceService;

            _resourceService.PreloadResource <Sprite>("brakesmoke");
            _resourceService.PreloadResource <Sprite>("spindashsmoke");

            _resourceService.PreloadResource <Sound>("brake");
            _resourceService.PreloadResource <Sound>("jump");
            _resourceService.PreloadResource <Sound>("roll");
            _resourceService.PreloadResource <Sound>("spindash");
            _resourceService.PreloadResource <Sound>("spindash_release");
            _resourceService.PreloadResource <Sound>("ring_loss");

            MoveController = _moveController = new PlayerMoveController(this, _collisionService, _varService, _inputService, _audioService);
            Options       |= EntityOptions.Collidable;
            SolidType      = SolidType.None;
            CollisionPath  = 0;
            RenderPriority = RenderPriority.High;

            _lookup    = false;
            _crouching = false;

            _takingDamage        = false;
            _invulnerabilityTime = 0.0;
            _nextFlashTime       = 0.0;
            _invulnerable        = false;
            _springing           = false;

            SetBoundingBox(StandingBox);
        }
コード例 #11
0
 public SearchController(ISearchService search,
                         IRenderService renderService)
 {
     this._searchService = search;
     this._renderService = renderService;
 }
コード例 #12
0
ファイル: GameObjectAsync.cs プロジェクト: XinliZ/MonoEngine
 public override void Draw(IRenderService renderService, GameTime gameTime)
 {
     if (animation != null)
     {
         animation.Draw(renderService, gameTime, 200, 300);      // TODO: Remove the hard code numbers
     }
 }
コード例 #13
0
 public JsReportMiddleware(RequestDelegate next, IRenderService renderService)
 {
     _next          = next;
     _renderService = renderService;
 }
コード例 #14
0
 public EmailService(CMSContext context, IRenderService renderService)
 {
     _email         = context.EmailSettings.FirstOrDefault();
     _renderService = renderService;
 }
コード例 #15
0
 public ActionController(IRenderService renderer)
 {
     _renderer = renderer;
 }
コード例 #16
0
 public DocPdfConverter(IDbRepository dbRepository, ITemplateService templateService, IRenderService renderService)
 {
     _dbRepository    = dbRepository;
     _templateService = templateService;
     _renderService   = renderService;
 }
コード例 #17
0
 /// <summary>
 /// Add IRenderService and IJsReportMVCService to the DI services container
 /// </summary>
 /// <example>
 /// public void ConfigureServices(IServiceCollection services)
 /// {
 ///    services.AddJsReport(new LocalReporting().AsUtility().Create());
 /// }
 /// </example>
 public static IServiceCollection AddJsReport(this IServiceCollection services, IRenderService renderService)
 {
     return(services
            .AddSingleton(renderService)
            .AddSingleton <IJsReportMVCService>(new JsReportMVCService(renderService)));
 }
コード例 #18
0
 public HomeController(IRenderService renderService)
 {
     _renderService = renderService;
 }
コード例 #19
0
 public FundingSummary(IExcelFileService excelFileService, IFileNameService fileNameService, IFundingSummaryDataProvider fundingSummaryDataProvider, IFundingSummaryModelBuilder fundingSummaryModelBuilder, IRenderService <FundingSummaryReportModel> fundingSummaryRenderService, IReportDataPersistanceService <FundingSummaryReport> persistanceService, IFundingSummaryPersistanceMapper fundingSummaryPersistanceMapper)
 {
     _excelFileService                = excelFileService;
     _fileNameService                 = fileNameService;
     _fundingSummaryDataProvider      = fundingSummaryDataProvider;
     _fundingSummaryModelBuilder      = fundingSummaryModelBuilder;
     _fundingSummaryRenderService     = fundingSummaryRenderService;
     _persistanceService              = persistanceService;
     _fundingSummaryPersistanceMapper = fundingSummaryPersistanceMapper;
 }
コード例 #20
0
ファイル: SeriesController.cs プロジェクト: krisk0su/Movies
 public SeriesController(ISeriesService service,
                         IRenderService renderService)
 {
     this._seriesService = service;
     this._renderService = renderService;
 }
コード例 #21
0
 public UserServices(IUserRepository userRepository, IMediaService mediaService, IRenderService renderService,
                     IConfiguration configuration, DatabaseContext context)
 {
     _userRepository = userRepository;
     _mediaService   = mediaService;
     _renderService  = renderService;
     _configuration  = configuration;
     _context        = context;
 }
コード例 #22
0
ファイル: AnimesController.cs プロジェクト: krisk0su/Movies
 public AnimesController(IAnimesService animesService,
                         IRenderService renderService)
 {
     this._animesService = animesService;
     this._renderService = renderService;
 }
コード例 #23
0
 public ReportGenerator(IRenderService renderService)
 {
     _renderService     = renderService;
     _handlebarsHelpers = LoadHandlebarsHelpers();
 }
コード例 #24
0
 public PrimitiveController(IRenderService renderService)
 {
     this.renderService = renderService;
 }
コード例 #25
0
 public FrmReport(IList <IFrmWorksheetReport> frmReports, IFileNameService fileNameService, IExcelFileService excelService, IModelBuilder <IFrmSummaryReport> frmSummaryReportModelBuilder, IRenderService <IFrmSummaryReport> frmSummaryReportRenderService)
     : base("TaskGenerateFundingRulesMonitoringReport", "Funding Rules Monitoring Report")
 {
     _frmReports      = frmReports;
     _fileNameService = fileNameService;
     _excelService    = excelService;
     _frmSummaryReportModelBuilder  = frmSummaryReportModelBuilder;
     _frmSummaryReportRenderService = frmSummaryReportRenderService;
 }
コード例 #26
0
 public JsReportFilterAttribute(IRenderService renderService)
 {
     RenderService = renderService;
 }
コード例 #27
0
ファイル: Background.cs プロジェクト: XinliZ/MonoEngine
 public override void Draw(IRenderService renderService, GameTime gameTime)
 {
     renderService.SpriteBatch.Draw(BackgroundLayer0, Vector2.Zero, Color.White);
     renderService.SpriteBatch.Draw(BackgroundLayer1, Vector2.Zero, Color.White);
     renderService.SpriteBatch.Draw(BackgroundLayer2, Vector2.Zero, Color.White);
 }
コード例 #28
0
ファイル: Animation.cs プロジェクト: XinliZ/MonoEngine
 public void Draw(IRenderService renderService, GameTime gameTime, int x, int y)
 {
     renderService.SpriteBatch.Draw(texture, new Vector2(x, y), sourceRect, Color.White);
 }
 public Frm(IDictionary <string, IWorksheetReport> worksheets, IExcelFileService excelFileService, IFileNameService fileNameService, IReportDataProvider reportDataProvider, IModelBuilder <ISummaryModel> summaryPageModelBuilder, IRenderService <ISummaryModel> summaryPageRenderService)
 {
     _excelFileService        = excelFileService;
     _fileNameService         = fileNameService;
     _worksheets              = worksheets;
     _reportDataProvider      = reportDataProvider;
     _summaryPageModelBuilder = summaryPageModelBuilder;
     _summarPageRenderService = summaryPageRenderService;
 }
コード例 #30
0
 public StandardEmailSender(
     IEmailSender emailSender,
     IRenderService renderService
     ) : base(emailSender, renderService)
 {
 }
コード例 #31
0
        private RenderDataModel GetRenderStatus(IRenderService renderService)
        {
            RenderDataModel renderDataModel = renderService.GetRenderDataModel();

            return(renderDataModel);
        }
コード例 #32
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Renderer" /> class.
        /// </summary>
        /// <param name="gameEngine">The game engine.</param>
        /// <param name="form">The form.</param>
        /// <param name="width">The primary width of the view in pixels.</param>
        /// <param name="height">The primary height of the view in pixels.</param>
        public Renderer(IGameEngine gameEngine, GameForm form, int width, int height)
        {
            if (gameEngine == null)
            {
                throw new ArgumentNullException(nameof(gameEngine));
            }

            if (form == null)
            {
                throw new ArgumentNullException(nameof(form));
            }

            _form   = form;
            _resize = false;
            _scale  = 1.0f;
            _width  = width;
            _height = height;

            _dwFactory = new SharpDX.DirectWrite.Factory();
            InitFonts();

            // DeviceCreationFlags.BgraSupport must be enabled to allow Direct2D interop.
            SharpDX.Direct3D11.Device defaultDevice = new SharpDX.Direct3D11.Device(DriverType.Hardware, DeviceCreationFlags.Debug | DeviceCreationFlags.BgraSupport);

            // Query the default device for the supported device and context interfaces.
            _device     = defaultDevice.QueryInterface <SharpDX.Direct3D11.Device1>();
            _d3dContext = _device.ImmediateContext.QueryInterface <SharpDX.Direct3D11.DeviceContext1>();

            // Query for the adapter and more advanced DXGI objects.
            using (var dxgiDevice2 = _device.QueryInterface <SharpDX.DXGI.Device2>())
            {
                _d2dFactory = new SharpDX.Direct2D1.Factory2(SharpDX.Direct2D1.FactoryType.SingleThreaded);

                // Get the default Direct2D device and create a context.
                using (var d2dDevice = new SharpDX.Direct2D1.Device1(_d2dFactory, dxgiDevice2))
                {
                    _d2dContext = new SharpDX.Direct2D1.DeviceContext1(d2dDevice, SharpDX.Direct2D1.DeviceContextOptions.None);
                }
            }

            CreateSizeDependentResources();

            _d2dContext.TextAntialiasMode = SharpDX.Direct2D1.TextAntialiasMode.Aliased;
            _d2dContext.AntialiasMode     = AntialiasMode.Aliased;
            _d2dContext.UnitMode          = UnitMode.Pixels;

            _hudYellow     = new SolidColorBrush(_d2dContext, new Color4(1.0f, 1.0f, 0.0f, 1.0f));
            _hudWhite      = new SolidColorBrush(_d2dContext, new Color4(1.0f, 1.0f, 1.0f, 1.0f));
            _hudTextFormat = new TextFormat(_dwFactory, "Sonic Genesis/Mega Drive Font", _fontCollection, FontWeight.Normal, FontStyle.Normal, FontStretch.Normal, 14);

            // init game stuff
            _game = gameEngine;

            _texResMan    = new TextureResourceManager(gameEngine, _d2dContext);
            _spriteResMan = new SpriteResourceManager(gameEngine, _d2dContext);

            // get the services
            _mapService       = _game.GetService <IMapService>();
            _varService       = _game.GetService <IVariableService>();
            _entityService    = _game.GetService <IEntityService>();
            _renderService    = _game.GetService <IRenderService>();
            _collisionService = _game.GetService <ICollisionService>();

            _varShowCollisionMaps  = _varService.GetVar <bool>("r_showcollisionmaps");
            _varShowTileFrames     = _varService.GetVar <bool>("r_showtileframes");
            _varShowEntityOrigins  = _varService.GetVar <bool>("r_showentityorigins");
            _varShowTraceLines     = _varService.GetVar <bool>("r_showtracelines");
            _varShowCollisionBoxes = _varService.GetVar <bool>("r_showcollisionboxes");

            _rc = new RenderContext();

            _spriteRenderList = new List <Animatable>(25);
        }
コード例 #33
0
 public JsReportMVCService(IRenderService rs)
 {
     _renderService = rs;
 }
コード例 #34
0
 public DocumentPDFController(IRenderService renderService)
 {
     _renderService = renderService;
 }
コード例 #35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Player" /> class.
        /// </summary>
        /// <param name="resourceService">The resource service.</param>
        /// <param name="renderService">The render service.</param>
        /// <param name="varService">The variable service.</param>
        /// <param name="inputService">The input service.</param>
        /// <param name="entityService">The entity service.</param>
        /// <param name="audioService"></param>
        /// <param name="collisionService"></param>
        public Sonic(
            IResourceService resourceService,
            IRenderService renderService,
            IVariableService varService,
            IInputService inputService,
            IEntityService entityService,
            IAudioService audioService,
            ICollisionService collisionService)
            : base(
                resourceService,
                renderService,
                varService,
                inputService,
                entityService,
                audioService,
                collisionService)
        {
            if (resourceService == null)
            {
                throw new ArgumentNullException(nameof(resourceService));
            }

            if (renderService == null)
            {
                throw new ArgumentNullException(nameof(renderService));
            }

            if (varService == null)
            {
                throw new ArgumentNullException(nameof(varService));
            }

            if (inputService == null)
            {
                throw new ArgumentNullException(nameof(inputService));
            }

            if (entityService == null)
            {
                throw new ArgumentNullException(nameof(entityService));
            }

            if (audioService == null)
            {
                throw new ArgumentNullException(nameof(audioService));
            }

            if (collisionService == null)
            {
                throw new ArgumentNullException(nameof(collisionService));
            }

            _entityService    = entityService;
            _varService       = varService;
            _renderService    = renderService;
            _inputService     = inputService;
            _audioService     = audioService;
            _collisionService = collisionService;

            _resourceService = resourceService;
            _resourceService.PreloadResource <Sprite>("sonic");
        }
コード例 #36
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CollisionService" /> class.
        /// </summary>
        /// <param name="entityService">The entity service.</param>
        /// <param name="mapService">The map service.</param>
        /// <param name="renderService">The render service.</param>
        /// <param name="varService">The variable service.</param>
        public CollisionService(IEntityService entityService, IMapService mapService, IRenderService renderService, IVariableService varService)
        {
            if (entityService == null)
            {
                throw new ArgumentNullException(nameof(entityService));
            }

            if (mapService == null)
            {
                throw new ArgumentNullException(nameof(mapService));
            }

            if (renderService == null)
            {
                throw new ArgumentNullException(nameof(renderService));
            }

            if (varService == null)
            {
                throw new ArgumentNullException(nameof(varService));
            }

            _entityService = entityService;
            _mapService    = mapService;
            _renderService = renderService;
            _varService    = varService;

            _quadPool    = new QuadtreePool();
            _entListPool = new ObjectPool <List <GameEntity> >(() => new List <GameEntity>(10));

            _varShowTracelines = _varService.GetVar <bool>("r_showtracelines");
        }