public SpriteRenderSystem() : base( Aspect.All( typeof(SpriteComponent), typeof(PositionComponent))) { }
public PlayerShipControlSystem(EntityFactory entityFactory) : base(Aspect.All(typeof(PlayerComponent), typeof(Transform2))) { _entityFactory = entityFactory; _missileLaunchDelay = TimeSpan.FromMilliseconds(250); _missileLaunchTimer = TimeSpan.Zero; }
public PlayerStateSystem(IInputManager inputManager, EntityWorld world) : base(Aspect.All(typeof(PlayerStateMap))) { _inputManager = inputManager; _world = world; }
public SpriteSystem() : base( Aspect.All( typeof(SpriteComponent), typeof(ContentManagerComponent))) { }
public PlayerInputSystem() : base( Aspect.All( typeof(PlayerInputComponent), typeof(InputIntentComponent))) { }
public Entity FindNearest(Entity thing, ThingType thingType) { Entity foundThing = null; float bestDist = 99999999f; var b = thing.entityWorld.EntityManager.GetEntities(Aspect.All(typeof(ThingComp))); foreach (Entity e in b) { var tc = e.GetComponent <ThingComp>(); if (tc == this) { continue; } if (!tc.Active) { continue; } if (tc.Type == thingType) { float dist = (tc.Position - this.Position).Length(); if (dist < bestDist) { bestDist = dist; foundThing = e; } } } return(foundThing); }
public ArmDrawingSystem(SpriteBatch spriteBatch, Texture2D armTexture, Texture2D jointTexture) : base(Aspect.All(typeof(HandComponent), typeof(PositionComponent))) { _spriteBatch = spriteBatch; _armTexture = armTexture; _jointTexture = jointTexture; }
public RenderSystem(GraphicsDevice graphicsDevice, Camera camera) : base(Aspect.All(typeof(Sprite), typeof(Transform2))) { _graphicsDevice = graphicsDevice; _camera = camera; _spriteBatch = new SpriteBatch(graphicsDevice); }
public SpeedSystem() : base( Aspect.All( typeof(PositionComponent), typeof(SpeedComponent))) { }
public RendererSystem(GameApp gameApp) : base(Aspect .All(typeof(RenderFormComponent), typeof(Transform2D))) { _gameApp = gameApp; _sb = new SpriteBatch(_gameApp.GraphicsDevice); _camera = gameApp.Services.GetService <OrthographicCamera>(); }
public GoalSpeedSystem() : base( Aspect.All( typeof(SpeedComponent), typeof(GoalSpeedComponent))) { }
public RenderCollisionBoxSystem(SpriteBatch spriteBatch) : base(Aspect.All(typeof(CollisionBox), typeof(Position), typeof(Renderable))) { _spriteBatch = spriteBatch; }
public HudRenderSystem(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, BitmapFont font) : base(Aspect.All(typeof(PlayerComponent), typeof(HealthComponent))) { _graphicsDevice = graphicsDevice; _spriteBatch = spriteBatch; _font = font; }
public EntityCollisionSystem(IScriptManager scriptManager) : base(Aspect.All(typeof(Position), typeof(CollisionBox), typeof(Script))) { _scriptManager = scriptManager; }
public SpriteBinaryDirectionSystem() : base( Aspect.All( typeof(BinaryDirectionComponent), typeof(SpriteComponent))) { }
public void TestAspectAllMultiple() { Aspect aspect = Aspect.All(typeof(TestHealthComponent), typeof(TestPowerComponent)); EntityWorld entityWorld = new EntityWorld(); Entity entity; entity = entityWorld.CreateEntity(); Assert.IsFalse(aspect.Interests(entity), "Entity without components must NOT be subject to \"Healthy Powered\" Aspect"); entity = entityWorld.CreateEntity(); entity.AddComponent(new TestHealthComponent()); Assert.IsFalse(aspect.Interests(entity), "Entity with {TestHealthComponent} must NOT be subject to \"Healthy Powered\" Aspect"); entity = entityWorld.CreateEntity(); entity.AddComponent(new TestHealthComponent()); entity.AddComponent(new TestPowerComponentPoolable()); Assert.IsFalse(aspect.Interests(entity), "Entity with {TestHealthComponent, TestPowerComponentPoolable} must NOT be subject to \"Healthy Powered\" Aspect"); entity = entityWorld.CreateEntity(); entity.AddComponent(new TestHealthComponent()); entity.AddComponent(new TestPowerComponent()); Assert.IsTrue(aspect.Interests(entity), "Entity with {TestHealthComponent, TestPowerComponent} must be subject to \"Healthy Powered\" Aspect"); entity = entityWorld.CreateEntity(); entity.AddComponent(new TestHealthComponent()); entity.AddComponent(new TestPowerComponent()); entity.AddComponent(new TestPowerComponentPoolable()); Assert.IsTrue(aspect.Interests(entity), "Entity with {TestHealthComponent, TestPowerComponent, TestPowerComponentPoolable} must be subject to \"Healthy Powered\" Aspect"); }
public GUISystem(GraphicsDevice graphicsDevice) : base(Aspect .All(typeof(Transform2D), typeof(GUIStyle))) { _graphicsDevice = graphicsDevice; _sb = new SpriteBatch(_graphicsDevice); }
/// <summary>Initializes a new instance of the <see cref="EntitySystem" /> class.</summary> /// <param name="types">The types.</param> protected EntitySystem(params Type[] types) : this() { Debug.Assert(types != null, "Types must not be null."); Debug.Assert(types.Length != 0, "Types must not be zero lengthed."); this.Aspect = Aspect.All(types); this.Types = types; }
public RenderTextSystem(SpriteBatch spriteBatch, IContentManager contentManager) : base(Aspect.All(typeof(VisibleText), typeof(Position))) { _spriteBatch = spriteBatch; _contentManager = contentManager; }
public GridSystem(GraphicsDevice graphicsDevice, Camera camera, Texture2D grassTexture) : base(Aspect.All(typeof(Hex), typeof(Sprite), typeof(Transform2))) { _graphicsDevice = graphicsDevice; _camera = camera; _grassTexture = grassTexture; _spriteBatch = new SpriteBatch(graphicsDevice); }
public InteractionSystem(ViewportAdapter viewportAdapter = null) : base(Aspect .All(typeof(Interaction2DComponent), typeof(Transform2DComponent))) { _viewportAdapter = viewportAdapter; current_pressedButtons = Array.Empty <MouseButtons>(); prev_pressedButtons = Array.Empty <MouseButtons>(); }
/// <inheritdoc /> public HeartbeatSystem(EntityWorld world, IScriptService scriptService) : base(Aspect.All(typeof(Heartbeat), typeof(ScriptGroup))) { _world = world; _scriptService = scriptService; }
public HeartbeatSystem(IScriptManager scriptManager, EntityWorld world) : base(Aspect.All(typeof(Heartbeat), typeof(Script))) { _scriptManager = scriptManager; _world = world; }
public SpriteSystem(EntityWorld world) : base(Aspect.All( typeof(Sprite), typeof(Renderable), typeof(Position))) { _world = world; }
public RenderHudSystem(GameApp gameApp) : base(Aspect .All(typeof(TagHUDComponent), typeof(RenderFormComponent))) { _gameApp = gameApp; _sb = new SpriteBatch(_gameApp.GraphicsDevice); _viewportAdapter = new ScalingViewportAdapter(_gameApp.GraphicsDevice, GameApp.DefaultWidth, GameApp.DefaultHeight); }
public IndicatorDrawSystem(SpriteBatch spriteBatch, ContentManager content) : base(Aspect.All(typeof(PositionComponent), typeof(IndicatorComponent))) { this.spriteBatch = spriteBatch; // Load content. cardAttributeFont = content.Load <SpriteFont>("Fonts/card_attribute_font"); }
public MapCollisionSystem() : base( Aspect.All( typeof(PositionComponent), typeof(SpeedComponent), typeof(AABBComponent))) { }
public RenderSystem(SpriteBatch spriteBatch, OrthographicCamera camera, ContentManager content) : base(Aspect.All(typeof(Transform2)).One(typeof(AnimatedSprite), typeof(Sprite)).Exclude(typeof(Tile), typeof(DotPlayer))) { this.spriteBatch = spriteBatch; this.camera = camera; this.content = content; damageEffect = content.Load <Effect>("Effects/damage_effect"); }
public LevelCollisionSystem(EntityWorld world, IInputManager input) : base(Aspect.All(typeof(CollisionBox), typeof(Position), typeof(Velocity))) { _world = world; _input = input; }
public void IsInterestedInAllComponents() { var allAspect = Aspect .All(typeof(Sprite), typeof(Transform2), typeof(DummyComponent)) .Build(_componentManager); Assert.True(allAspect.IsInterested(_entityA)); Assert.False(allAspect.IsInterested(_entityB)); }