public LabelUserInterfaceNodeProcessor( IAssetManagerProvider assetManagerProvider, INodeColorParser nodeColorParser) { _nodeColorParser = nodeColorParser; _assetManager = assetManagerProvider.GetAssetManager(); }
/// <summary> /// Initializes a new instance of the <see cref="Default2DRenderUtilities"/> class. /// </summary> /// <param name="stringSanitizer"> /// The dependency injected <see cref="IStringSanitizer"/> instance. /// </param> public Default2DRenderUtilities( IStringSanitizer stringSanitizer, IAssetManagerProvider assetManagerProvider) { this.m_StringSanitizer = stringSanitizer; this.m_ColorEffect = assetManagerProvider.GetAssetManager().Get <EffectAsset>("effect.Color").Effect; }
public GoalEntity( I2DRenderUtilities twodRenderUtilities, ICubeRenderer cubeRenderer, IAssetManagerProvider assetManagerProvider, INetworkAPI networkAPI, int id, int x, int y, Dictionary<string, string> attributes) : base(twodRenderUtilities, cubeRenderer, assetManagerProvider, networkAPI, Convert.ToInt32(attributes["NetworkID"])) { this.X = x / 16f + 0.4f; this.Z = y / 16f + 0.4f; this.CanPickup = false; this.JoinShouldOwn = Convert.ToBoolean(attributes["JoinOwns"]); this.Width = 0.2f; this.Depth = 0.2f; this.m_GoalTexture = assetManagerProvider.GetAssetManager().Get<TextureAsset>("texture.Goal"); this.m_GoalModel = assetManagerProvider.GetAssetManager().Get<ModelAsset>("model.Goal"); }
public MyGameWorld( I2DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider, IEntityFactory entityFactory) { this.Entities = new List<IEntity>(); _renderUtilities = renderUtilities; _assetManager = assetManagerProvider.GetAssetManager(); _defaultFont = this._assetManager.Get<FontAsset>("font.Default"); // You can also save the entity factory in a field and use it, e.g. in the Update // loop or anywhere else in your game. var entityA = entityFactory.CreateExampleEntity("EntityA"); entityA.X = 100; entityA.Y = 50; var entityB = entityFactory.CreateExampleEntity("EntityB"); entityB.X = 120; entityB.Y = 100; // Don't forget to add your entities to the world! this.Entities.Add(entityA); this.Entities.Add(entityB); // This pulls in the texture asset via the asset manager. Note that // the folder seperator from "texture/Player" has been translated // into a single dot. _playerTexture = _assetManager.Get<TextureAsset>("texture.Player"); }
public GoalEntity( I2DRenderUtilities twodRenderUtilities, ICubeRenderer cubeRenderer, IAssetManagerProvider assetManagerProvider, INetworkAPI networkAPI, int id, int x, int y, Dictionary <string, string> attributes) : base(twodRenderUtilities, cubeRenderer, assetManagerProvider, networkAPI, Convert.ToInt32(attributes["NetworkID"])) { this.X = x / 16f + 0.4f; this.Z = y / 16f + 0.4f; this.CanPickup = false; this.JoinShouldOwn = Convert.ToBoolean(attributes["JoinOwns"]); this.Width = 0.2f; this.Depth = 0.2f; this.m_GoalTexture = assetManagerProvider.GetAssetManager().Get <TextureAsset>("texture.Goal"); this.m_GoalModel = assetManagerProvider.GetAssetManager().Get <ModelAsset>("model.Goal"); }
public CrateEntity( I2DRenderUtilities twodRenderUtilities, ICubeRenderer cubeRenderer, IAssetManagerProvider assetManagerProvider, INetworkAPI networkAPI, int id, int x, int y, Dictionary<string, string> attributes) : base(twodRenderUtilities, cubeRenderer, assetManagerProvider, networkAPI, Convert.ToInt32(attributes["NetworkID"])) { this.X = x / 16f; this.Z = y / 16f; this.JoinShouldOwn = Convert.ToBoolean(attributes["JoinOwns"]); this.CanPush = true; this.Width = 0.8f; this.Depth = 0.8f; this.m_BlueCrateTexture = assetManagerProvider.GetAssetManager().Get<TextureAsset>("texture.BlueCrate"); this.m_RedCrateTexture = assetManagerProvider.GetAssetManager().Get<TextureAsset>("texture.RedCrate"); this.m_CrateModel = assetManagerProvider.GetAssetManager().Get<ModelAsset>("model.Crate"); }
/// <summary> /// Initializes a new instance of the <see cref="Default2DRenderUtilities"/> class. /// </summary> /// <param name="stringSanitizer"> /// The dependency injected <see cref="IStringSanitizer"/> instance. /// </param> public Default2DRenderUtilities( IStringSanitizer stringSanitizer, IAssetManagerProvider assetManagerProvider) { this.m_StringSanitizer = stringSanitizer; this.m_ColorEffect = assetManagerProvider.GetAssetManager().Get<EffectAsset>("effect.Color").Effect; }
public PlayerEntity( I2DRenderUtilities twodRenderUtilities, ICubeRenderer cubeRenderer, IAssetManagerProvider assetManagerProvider, INetworkAPI networkAPI, bool isRedColor, bool locallyOwned) { this.m_NetworkAPI = networkAPI; this.m_2DRenderUtilities = twodRenderUtilities; this.m_CubeRenderer = cubeRenderer; this.m_PlayerTexture = assetManagerProvider.GetAssetManager().Get<TextureAsset>("texture." + (isRedColor ? "Red" : "Blue")); this.LocallyOwned = locallyOwned; this.Width = 0.5f; this.Depth = 0.5f; if (!this.LocallyOwned) { networkAPI.ListenForMessage( "player update", a => { var values = a.Split('|').Select(x => float.Parse(x)).ToArray(); this.X = values[0]; this.Y = values[1]; this.Z = values[2]; }); } }
public MyGameWorld( I2DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider, IEntityFactory entityFactory) { this.Entities = new List <IEntity>(); _renderUtilities = renderUtilities; _assetManager = assetManagerProvider.GetAssetManager(); _defaultFont = this._assetManager.Get <FontAsset>("font.Default"); // You can also save the entity factory in a field and use it, e.g. in the Update // loop or anywhere else in your game. var entityA = entityFactory.CreateExampleEntity("EntityA"); entityA.X = 100; entityA.Y = 50; var entityB = entityFactory.CreateExampleEntity("EntityB"); entityB.X = 120; entityB.Y = 100; // Don't forget to add your entities to the world! this.Entities.Add(entityA); this.Entities.Add(entityB); // This pulls in the texture asset via the asset manager. Note that // the folder seperator from "texture/Player" has been translated // into a single dot. _playerTexture = _assetManager.Get <TextureAsset>("texture.Player"); }
public PlayerEntity( I2DRenderUtilities twodRenderUtilities, ICubeRenderer cubeRenderer, IAssetManagerProvider assetManagerProvider, INetworkAPI networkAPI, bool isRedColor, bool locallyOwned) { this.m_NetworkAPI = networkAPI; this.m_2DRenderUtilities = twodRenderUtilities; this.m_CubeRenderer = cubeRenderer; this.m_PlayerTexture = assetManagerProvider.GetAssetManager().Get <TextureAsset>("texture." + (isRedColor ? "Red" : "Blue")); this.LocallyOwned = locallyOwned; this.Width = 0.5f; this.Depth = 0.5f; if (!this.LocallyOwned) { networkAPI.ListenForMessage( "player update", a => { var values = a.Split('|').Select(x => float.Parse(x)).ToArray(); this.X = values[0]; this.Y = values[1]; this.Z = values[2]; }); } }
public TitleWorld( I2DRenderUtilities twodRenderUtilities, IAssetManagerProvider assetManagerProvider, IBackgroundCubeEntityFactory backgroundCubeEntityFactory, ISkin skin) : base(twodRenderUtilities, assetManagerProvider, backgroundCubeEntityFactory, skin) { this.Title = this.AssetManager.Get<LanguageAsset>("language.TYCHAIA"); this.AddMenuItem( this.AssetManager.Get<LanguageAsset>("language.SINGLEPLAYER"), () => { this.TargetWorld = this.GameContext.CreateWorld<IWorldFactory>(x => x.CreateConnectWorld(true, GetLANIPAddress(), 9091)); }); this.AddMenuItem( this.AssetManager.Get<LanguageAsset>("language.MULTIPLAYER"), () => { this.TargetWorld = this.GameContext.CreateWorld<IWorldFactory>(x => x.CreateMultiplayerWorld()); }); this.AddMenuItem( this.AssetManager.Get<LanguageAsset>("language.EXIT"), () => { if (this.GameContext != null) this.GameContext.Game.Exit(); }); }
public DefaultCaptureService( I2DRenderUtilities twoDRenderUtilities, IAssetManagerProvider assetManagerProvider) { this.m_2DRenderUtilities = twoDRenderUtilities; this.m_DefaultFont = assetManagerProvider.GetAssetManager().Get<FontAsset>("font.Default"); }
public DefaultDebugRenderPass(IAssetManagerProvider assetManagerProvider) { _basicEffect = assetManagerProvider.GetAssetManager().Get<UberEffectAsset>("effect.BuiltinSurface").Effects["Color"]; Lines = new List<VertexPositionNormalColor>(); Triangles = new List<VertexPositionNormalColor>(); EnabledLayers = new List<IDebugLayer>(); }
public DefaultDebugRenderPass(IAssetManagerProvider assetManagerProvider) { _basicEffect = assetManagerProvider.GetAssetManager().Get <UberEffectAsset>("effect.BuiltinSurface").Effects["Color"]; Lines = new List <VertexPositionNormalColor>(); Triangles = new List <VertexPositionNormalColor>(); EnabledLayers = new List <IDebugLayer>(); }
public CrateEntity( I2DRenderUtilities twodRenderUtilities, ICubeRenderer cubeRenderer, IAssetManagerProvider assetManagerProvider, INetworkAPI networkAPI, int id, int x, int y, Dictionary <string, string> attributes) : base(twodRenderUtilities, cubeRenderer, assetManagerProvider, networkAPI, Convert.ToInt32(attributes["NetworkID"])) { this.X = x / 16f; this.Z = y / 16f; this.JoinShouldOwn = Convert.ToBoolean(attributes["JoinOwns"]); this.CanPush = true; this.Width = 0.8f; this.Depth = 0.8f; this.m_BlueCrateTexture = assetManagerProvider.GetAssetManager().Get <TextureAsset>("texture.BlueCrate"); this.m_RedCrateTexture = assetManagerProvider.GetAssetManager().Get <TextureAsset>("texture.RedCrate"); this.m_CrateModel = assetManagerProvider.GetAssetManager().Get <ModelAsset>("model.Crate"); }
public Render3DPlaneComponent(INode node, I3DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider) { _node = node; _renderUtilities = renderUtilities; Enabled = true; Effect = assetManagerProvider.GetAssetManager().Get<EffectAsset>("effect.Color"); }
public StatusBar( I2DRenderUtilities twodRenderUtilities, IAssetManagerProvider assetManagerProvider) { this.m_2DRenderUtilities = twodRenderUtilities; this.m_AssetManager = assetManagerProvider.GetAssetManager(); this.m_DefaultFont = this.m_AssetManager.Get<FontAsset>("font.Default"); }
public MenuWorld(ISkin skin, IWorldFactory worldFactory, IAssetManagerProvider assetManagerProvider, I2DRenderUtilities twodRenderUtilities) { this.m_2DRenderUtilities = twodRenderUtilities; this.m_LogoTexture = assetManagerProvider.GetAssetManager().Get<TextureAsset>("texture.Logo"); this.m_WorldFactory = worldFactory; this.Entities = new List<IEntity>(); var startServer = new Button(); startServer.Text = "Start Server"; startServer.Click += (sender, e) => { this.m_LastGameContext.SwitchWorld<IWorldFactory>( x => x.CreateLobbyWorld(false, IPAddress.Any)); }; var ipAddressTextBox = new TextBox(); var joinGame = new Button(); joinGame.Text = "Join Game"; joinGame.Click += (sender, e) => { this.m_LastGameContext.SwitchWorld<IWorldFactory>( x => x.CreateLobbyWorld(true, IPAddress.Parse(ipAddressTextBox.Text))); }; var exitGame = new Button(); exitGame.Text = "Exit Game"; exitGame.Click += (sender, e) => { this.m_LastGameContext.Game.Exit(); }; var vertical = new VerticalContainer(); vertical.AddChild(new EmptyContainer(), "*"); vertical.AddChild(new Label { Text = "Perspective" }, "25"); vertical.AddChild(new EmptyContainer(), "*"); vertical.AddChild(startServer, "25"); vertical.AddChild(new EmptyContainer(), "*"); vertical.AddChild(new Label { Text = "Server IP address:" }, "20"); vertical.AddChild(ipAddressTextBox, "20"); vertical.AddChild(joinGame, "25"); vertical.AddChild(new EmptyContainer(), "*"); vertical.AddChild(exitGame, "25"); vertical.AddChild(new EmptyContainer(), "*"); var horizontal = new HorizontalContainer(); horizontal.AddChild(new EmptyContainer(), "*"); horizontal.AddChild(vertical, "250"); horizontal.AddChild(new EmptyContainer(), "*"); var canvas = new Canvas(); canvas.SetChild(horizontal); this.Entities.Add(new CanvasEntity(skin, canvas)); }
/// <summary> /// Initializes a new instance of the <see cref="BasicSkin"/> class. /// </summary> /// <param name="skin"> /// The skin. /// </param> /// <param name="renderUtilities"> /// The render utilities. /// </param> /// <param name="assetManagerProvider"> /// The asset manager provider. /// </param> public TransparentBasicSkin( IBasicSkin skin, I2DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider) { this.m_BasicSkin = skin; this.m_RenderUtilities = renderUtilities; this.m_AssetManager = assetManagerProvider.GetAssetManager(false); }
/// <summary> /// Initializes a new instance of the <see cref="MenuItem"/> class. /// </summary> /// <param name="assetManagerProvider"> /// The asset manager provider. /// </param> /// <param name="renderUtilities"> /// The render utilities. /// </param> public MenuItem(IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities) { this.m_RenderUtilities = renderUtilities; this.m_AssetManager = assetManagerProvider.GetAssetManager(false); this.Active = false; // Give menu items a higher visibility over other things. this.Order = 10; }
public TychaiaSkin( I2DRenderUtilities twodRenderUtilities, IAssetManagerProvider assetManagerProvider, BasicSkin basicSkin) { this.m_2DRenderUtilities = twodRenderUtilities; this.m_BasicSkin = basicSkin; this.m_AssetManager = assetManagerProvider.GetAssetManager(false); }
public PhysicsMetricsProfilerVisualiser( IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities, IPhysicsEngine physicsEngine) { _renderUtilities = renderUtilities; _physicsEngine = physicsEngine; _defaultFont = assetManagerProvider.GetAssetManager().Get<FontAsset>("font.Default"); }
public BasicLabelSkinRenderer( I2DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider, ILayoutPosition layoutPosition) { _renderUtilities = renderUtilities; _layoutPosition = layoutPosition; _fontAsset = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); }
public Render3DCubeComponent(INode node, I3DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider) { _node = node; _renderUtilities = renderUtilities; Enabled = true; Effect = assetManagerProvider.GetAssetManager().Get <UberEffectAsset>("effect.BuiltinSurface").Effects?["Color"]; Transform = new DefaultTransform(); }
public PhysicsMetricsProfilerVisualiser( IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities, IPhysicsEngine physicsEngine) { _renderUtilities = renderUtilities; _physicsEngine = physicsEngine; _defaultFont = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); }
public Render3DCubeComponent(INode node, I3DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider) { _node = node; _renderUtilities = renderUtilities; Enabled = true; Effect = assetManagerProvider.GetAssetManager().Get<UberEffectAsset>("effect.BuiltinSurface").Effects?["Color"]; Transform = new DefaultTransform(); }
/// <summary> /// Initializes a new instance of the <see cref="BasicSkin"/> class. /// </summary> /// <param name="skin"> /// The skin. /// </param> /// <param name="renderUtilities"> /// The render utilities. /// </param> /// <param name="assetManagerProvider"> /// The asset manager provider. /// </param> public BasicSkin( IBasicSkin skin, I2DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider) { this.m_BasicSkin = skin; this.m_RenderUtilities = renderUtilities; this.m_AssetManager = assetManagerProvider.GetAssetManager(false); }
public GeneratedWorld( I2DRenderUtilities twoDRenderUtilities, IAssetManagerProvider assetManagerProvider) { this.Entities = new List<IEntity>(); this.m_2DRenderUtilities = twoDRenderUtilities; this.m_AssetManager = assetManagerProvider.GetAssetManager(); this.m_DefaultFont = this.m_AssetManager.Get<FontAsset>("font.Default"); }
public GeneratedWorld( I2DRenderUtilities twoDRenderUtilities, IAssetManagerProvider assetManagerProvider) { this.Entities = new List <IEntity>(); this.m_2DRenderUtilities = twoDRenderUtilities; this.m_AssetManager = assetManagerProvider.GetAssetManager(); this.m_DefaultFont = this.m_AssetManager.Get <FontAsset>("font.Default"); }
/// <summary> /// Initializes a new instance of the <see cref="DefaultConsole"/> class. /// </summary> /// <param name="_2DRenderUtilities"> /// The _2 d render utilities. /// </param> /// <param name="keyboardStringReader"> /// The keyboard string reader. /// </param> /// <param name="assetManagerProvider"> /// The asset manager provider. /// </param> /// <param name="commands"> /// The commands. /// </param> public DefaultConsole( I2DRenderUtilities _2DRenderUtilities, IKeyboardStringReader keyboardStringReader, IAssetManagerProvider assetManagerProvider, ICommand[] commands) { this.m_2DRenderUtilities = _2DRenderUtilities; this.m_KeyboardStringReader = keyboardStringReader; this.m_AssetManagerProvider = assetManagerProvider; this.m_Commands = commands; }
public KernelMetricsProfilerVisualiser( IKernel kernel, IHierarchy hierachy, IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities) { _kernel = kernel; _hierachy = hierachy; _renderUtilities = renderUtilities; _defaultFont = assetManagerProvider.GetAssetManager().Get<FontAsset>("font.Default"); }
public KernelMetricsProfilerVisualiser( IKernel kernel, IHierarchy hierachy, IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities) { _kernel = kernel; _hierachy = hierachy; _renderUtilities = renderUtilities; _defaultFont = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); }
public Ship(IAssetManagerProvider assetManagerProvider, IFactory factory) { this.m_Factory = factory; this.Cells = new List<ShipCell>(); this.Rooms = new List<Room>(); this.m_CulledVertexBuffer = null; this.m_CulledIndexBuffer = null; this.m_BuffersNeedRecalculation = true; this.m_TextureAsset = assetManagerProvider.GetAssetManager().Get<TextureAsset>("ship"); }
public DefaultStandardDirectionalLight( IAssetManagerProvider assetManagerProvider, IGraphicsBlit graphicsBlit, Vector3 lightDirection, Color lightColor) { _graphicsBlit = graphicsBlit; LightDirection = lightDirection; LightColor = lightColor; _directionalLightEffect = assetManagerProvider.GetAssetManager().Get <EffectAsset>("effect.DirectionalLight"); }
public NetworkTrafficProfilerVisualiser( IAssetManagerProvider assetManagerProvider, INetworkEngine networkEngine, I2DRenderUtilities renderUtilities) { _defaultFont = assetManagerProvider.GetAssetManager().Get<FontAsset>("font.Default"); _networkEngine = networkEngine; _renderUtilities = renderUtilities; _sentSampler = new NetworkSampler(_renderUtilities, _defaultFont, "SENT"); _receivedSampler = new NetworkSampler(_renderUtilities, _defaultFont, "RECV"); }
public NetworkTrafficProfilerVisualiser( IAssetManagerProvider assetManagerProvider, INetworkEngine networkEngine, I2DRenderUtilities renderUtilities) { _defaultFont = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); _networkEngine = networkEngine; _renderUtilities = renderUtilities; _sentSampler = new NetworkSampler(_renderUtilities, _defaultFont, "SENT"); _receivedSampler = new NetworkSampler(_renderUtilities, _defaultFont, "RECV"); }
public DefaultStandardDirectionalLight( IAssetManagerProvider assetManagerProvider, IGraphicsBlit graphicsBlit, Vector3 lightDirection, Color lightColor) { _graphicsBlit = graphicsBlit; LightDirection = lightDirection; LightColor = lightColor; _directionalLightEffect = assetManagerProvider.GetAssetManager().Get<EffectAsset>("effect.DirectionalLight"); }
public GraphicsMetricsProfilerVisualiser( IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities, IRenderCache renderCache, IRenderAutoCache renderAutoCache, IRenderBatcher renderBatcher) { _renderUtilities = renderUtilities; _renderCache = renderCache; _renderAutoCache = renderAutoCache; _renderBatcher = renderBatcher; _defaultFont = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); }
public GraphicsMetricsProfilerVisualiser( IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities, IRenderCache renderCache, IRenderAutoCache renderAutoCache, IRenderBatcher renderBatcher) { _renderUtilities = renderUtilities; _renderCache = renderCache; _renderAutoCache = renderAutoCache; _renderBatcher = renderBatcher; _defaultFont = assetManagerProvider.GetAssetManager().Get<FontAsset>("font.Default"); }
public TychaiaProfilerEntity( TychaiaProfiler profiler, I2DRenderUtilities twodRenderUtilities, IAssetManagerProvider assetManagerProvider, IPersistentStorage persistentStorage) { this.Profiler = profiler; this.m_2DRenderUtilities = twodRenderUtilities; this.m_DefaultFontAsset = assetManagerProvider.GetAssetManager().Get<FontAsset>("font.Default"); this.m_ProfilingInformation = new List<FrameProfileInfo>(); this.m_PersistentStorage = persistentStorage; this.m_TychaiaProfilerEntityUtil = new TychaiaProfilerEntityUtil(); }
public ClientChunkGenerator( IChunkSizePolicy chunkSizePolicy, IAssetManagerProvider assetManagerProvider) { this.m_ChunkSizePolicy = chunkSizePolicy; this.m_AssetManager = assetManagerProvider.GetAssetManager(); this.m_TextureAtlasAsset = this.m_AssetManager.Get<TextureAtlasAsset>("atlas"); this.m_Pipeline = new ThreadedTaskPipeline<ChunkGenerationRequest>(); var thread = new Thread(this.Run) { IsBackground = true, Priority = ThreadPriority.Highest }; thread.Start(); }
public BackgroundCubeEntity( IAssetManagerProvider assetManagerProvider, bool atBottom) { this.m_Distance = m_Random.Next(1, 50); this.m_Rotation = m_Random.Next(0, 360); this.m_GrassAsset = assetManagerProvider.GetAssetManager().Get<TextureAsset>("texture.Grass"); this.X = (float)(m_Random.NextDouble() - 0.5) * 25; this.Z = (float)(m_Random.NextDouble() - 0.5) * 25; if (atBottom) this.Y = 10; else this.Y = ((float)m_Random.NextDouble() * 60) - 50; }
public LobbyWorld( IKernel kernel, I2DRenderUtilities twodRenderUtilities, IAssetManagerProvider assetManagerProvider, bool join, IPAddress address) { this.m_2DRenderUtilities = twodRenderUtilities; this.m_DefaultFont = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); this.Entities = new List <IEntity>(); this.m_NetworkAPI = new DefaultNetworkAPI(join, address); kernel.Bind <INetworkAPI>().ToMethod(x => this.m_NetworkAPI); }
public RoomEditorEntity( IKernel kernel, IMeshCollider meshCollider, I3DRenderUtilities threeRenderUtilities, IAssetManagerProvider assetManagerProvider, Room room) { this.m_Kernel = kernel; this.m_MeshCollider = meshCollider; this.m_3DRenderUtilities = threeRenderUtilities; this.m_Room = room; this.m_ShipTextureAsset = assetManagerProvider.GetAssetManager().Get<TextureAsset>("ship"); this.m_RoomEditorMode = RoomEditorMode.Hovering; }
public LobbyWorld( IKernel kernel, I2DRenderUtilities twodRenderUtilities, IAssetManagerProvider assetManagerProvider, bool join, IPAddress address) { this.m_2DRenderUtilities = twodRenderUtilities; this.m_DefaultFont = assetManagerProvider.GetAssetManager().Get<FontAsset>("font.Default"); this.Entities = new List<IEntity>(); this.m_NetworkAPI = new DefaultNetworkAPI(join, address); kernel.Bind<INetworkAPI>().ToMethod(x => this.m_NetworkAPI); }
public OperationCostProfilerVisualiser( IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities, IMemoryProfiler memoryProfiler) { _defaultFont = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); _renderUtilities = renderUtilities; _memoryProfiler = memoryProfiler; _averageOverTimePeriod = new Dictionary <string, double>(); _historyOverTimePeriod = new Dictionary <string, List <double> >(); _lastFrameToHaveData = new Dictionary <string, int>(); _maximumOverTimePeriod = new Dictionary <string, double>(); MicrosecondLimit = 14000; FramesToAnalyse = 240; }
public Default3DDeferredRenderPass( IHierarchy hierarchy, IRenderTargetBackBufferUtilities renderTargetBackBufferUtilities, IGraphicsBlit graphicsBlit, IAssetManagerProvider assetManagerProvider, IRenderBatcher renderBatcher) { _hierarchy = hierarchy; _renderTargetBackBufferUtilities = renderTargetBackBufferUtilities; _graphicsBlit = graphicsBlit; _renderBatcher = renderBatcher; _gbufferClearEffect = assetManagerProvider.GetAssetManager().Get<EffectAsset>("effect.GBufferClear"); _gbufferCombineEffect = assetManagerProvider.GetAssetManager().Get<EffectAsset>("effect.GBufferCombine"); }
// This is the player constructor. Both parameters are automatically dependency // injected when we call CreatePlayerEntity on the entity factory. public PlayerEntity( I2DRenderUtilities twodRenderUtilities, IAssetManagerProvider assetManagerProvider) { // Keep the 2D render utilities around for later. this.m_2DRenderUtilities = twodRenderUtilities; // Some implementations might assign the asset manager to a field, depending on // whether or not they need to look up assets during the update or render // loops. In this case we just need access to one texture, so we just keep // it in a local variable for easy access. var assetManager = assetManagerProvider.GetAssetManager(); // Retrieve the player texture. this.m_PlayerTexture = assetManager.Get <TextureAsset>("texture.Player"); }
public Default3DDeferredRenderPass( IHierarchy hierarchy, IRenderTargetBackBufferUtilities renderTargetBackBufferUtilities, IGraphicsBlit graphicsBlit, IAssetManagerProvider assetManagerProvider, IRenderBatcher renderBatcher) { _hierarchy = hierarchy; _renderTargetBackBufferUtilities = renderTargetBackBufferUtilities; _graphicsBlit = graphicsBlit; _renderBatcher = renderBatcher; _gbufferClearEffect = assetManagerProvider.GetAssetManager().Get <EffectAsset>("effect.GBufferClear"); _gbufferCombineEffect = assetManagerProvider.GetAssetManager().Get <EffectAsset>("effect.GBufferCombine"); }
public BaseNetworkEntity( I2DRenderUtilities twodRenderUtilities, ICubeRenderer cubeRenderer, IAssetManagerProvider assetManagerProvider, INetworkAPI networkAPI, int id) { this.m_NetworkAPI = networkAPI; this.m_2DRenderUtilities = twodRenderUtilities; this.m_CubeRenderer = cubeRenderer; this.LocallyOwned = true; this.ID = id; networkAPI.ListenForMessage( "entity update", a => { if (!this.LocallyOwned) { var values = a.Split('|').Select(x => float.Parse(x)).ToArray(); if ((int)values[0] == id) { this.X = values[1]; this.Y = values[2]; this.Z = values[3]; } } }); networkAPI.ListenForMessage( "take object", a => { if (this.LocallyOwned) { var values = a.Split('|').Select(x => float.Parse(x)).ToArray(); if ((int)values[0] == id) { // other player is now owning this object this.LocallyOwned = false; } } }); }
public RenderPipelineWorld(IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities, IGraphicsFactory graphicsFactory, IAssert assert) { _renderUtilities = renderUtilities; _assert = assert; _texture = assetManagerProvider.GetAssetManager().Get <TextureAsset>("texture.Player"); _invertPostProcess = graphicsFactory.CreateInvertPostProcessingRenderPass(); _blurPostProcess = graphicsFactory.CreateBlurPostProcessingRenderPass(); _customPostProcess = graphicsFactory.CreateCustomPostProcessingRenderPass("effect.MakeRed"); _captureInlinePostProcess = graphicsFactory.CreateCaptureInlinePostProcessingRenderPass(); _captureInlinePostProcess.RenderPipelineStateAvailable = d => { #if MANUAL_TEST #elif RECORDING using (var writer = new StreamWriter("output" + _frame + ".png")) { d.SaveAsPng(writer.BaseStream, Width, Height); } #else var baseStream = typeof(RenderPipelineWorld).Assembly.GetManifestResourceStream( "Protogame.Tests.Expected.RenderPipeline.output" + _frame + ".png"); var baseBytes = new byte[baseStream.Length]; baseStream.Read(baseBytes, 0, baseBytes.Length); var memoryStream = new MemoryStream(); d.SaveAsPng(memoryStream, Width, Height); var memoryBytes = new byte[memoryStream.Position]; memoryStream.Seek(0, SeekOrigin.Begin); memoryStream.Read(memoryBytes, 0, memoryBytes.Length); memoryStream.Dispose(); baseStream.Dispose(); _assert.Equal(baseBytes, memoryBytes); #endif #if MANUAL_TEST _manualTest++; if (_manualTest % 60 == 0) { _frame++; } #else _frame++; #endif }; this.Entities = new List <IEntity>(); }
public Render3DModelComponent( INode node, I3DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider, ITextureFromHintPath textureFromHintPath, IRenderBatcher renderBatcher) { _node = node; _renderUtilities = renderUtilities; _textureFromHintPath = textureFromHintPath; _renderBatcher = renderBatcher; _assetManager = assetManagerProvider.GetAssetManager(); _animationTracker = new Stopwatch(); Enabled = true; Transform = new DefaultTransform(); }
public DefaultStandardPointLight( IAssetManagerProvider assetManagerProvider, Vector3 lightPosition, Color lightColor, float lightRadius, float lightIntensity) { LightPosition = lightPosition; LightColor = lightColor; LightRadius = lightRadius; LightIntensity = lightIntensity; _pointLightEffect = assetManagerProvider.GetAssetManager().Get <EffectAsset>("effect.PointLight"); _pointLightSphereModel = assetManagerProvider.GetAssetManager().Get <ModelAsset>("model.LightSphere").InstantiateModel(); _parameterSet = _pointLightEffect.Effect.CreateParameterSet(); }
public EditorWorld( IKernel kernel, I2DRenderUtilities twodRenderUtilities, I3DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider) { this.Entities = new List <IEntity>(); this._2DrenderUtilities = twodRenderUtilities; this._renderUtilities = renderUtilities; this._assetManager = assetManagerProvider.GetAssetManager(); this._defaultFont = this._assetManager.Get <FontAsset>("font.Default"); this._count = 0; var entity = kernel.Get <CubeEntity>(); entity.LocalMatrix = Matrix.CreateTranslation(3.05f, 0, 2.1f); this.Entities.Add(entity); }
public LocatorEntity( IEditorQuery <LocatorEntity> editorQuery, IAssetManagerProvider assetManagerProvider, Render3DModelComponent modelComponent) { if (editorQuery.Mode != EditorQueryMode.BakingSchema) { _modelComponent = modelComponent; RegisterComponent(_modelComponent); var assetManager = assetManagerProvider.GetAssetManager(); editorQuery.MapTransform(this, Transform.Assign); var modelUri = editorQuery.GetRawResourceUris().FirstOrDefault(); if (modelUri != null) { var extIndex = modelUri.LastIndexOf(".", StringComparison.InvariantCulture); if (extIndex != -1) { modelUri = modelUri.Substring(0, extIndex); } var pathComponents = modelUri.Split('/').ToList(); while (pathComponents[0] == "..") { pathComponents.RemoveAt(0); } while (pathComponents.Count > 0) { var attemptAsset = string.Join(".", pathComponents); var resultAsset = assetManager.TryGet <ModelAsset>(attemptAsset); if (resultAsset == null) { pathComponents.RemoveAt(0); } else { _modelComponent.Model = resultAsset; break; } } } } }
public GCMetricsProfilerVisualiser( IAssetManagerProvider assetManagerProvider, I2DRenderUtilities renderUtilities) { _renderUtilities = renderUtilities; _defaultFont = assetManagerProvider.GetAssetManager().Get <FontAsset>("font.Default"); #if PLATFORM_WINDOWS || PLATFORM_MACOS || PLATFORM_LINUX string instanceName; if (TryGetInstanceName(Process.GetCurrentProcess(), out instanceName)) { _gen0PerformanceCounter = new PerformanceCounter(".NET CLR Memory", "# Gen 0 Collections", instanceName, true); _gen1PerformanceCounter = new PerformanceCounter(".NET CLR Memory", "# Gen 1 Collections", instanceName, true); _gen2PerformanceCounter = new PerformanceCounter(".NET CLR Memory", "# Gen 2 Collections", instanceName, true); } #endif }
public EditorWorld( IKernel kernel, I2DRenderUtilities twodRenderUtilities, I3DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider) { this.Entities = new List <IEntity>(); this._2DrenderUtilities = twodRenderUtilities; this._renderUtilities = renderUtilities; this._assetManager = assetManagerProvider.GetAssetManager(); this._defaultFont = this._assetManager.Get <FontAsset>("font.Default"); this._count = 0; var entity = kernel.Get <CubeEntity>(); entity.X = 3.05f; entity.Y = 0; entity.Z = 2.1f; this.Entities.Add(entity); }