public virtual void AddEntity(Entity entity) { //Subscribe to the destory event entity.DestroyEvent += RemoveEntity; entity.CreateEvent += AddEntity; NewEntities.Add(entity); if (EntityAdded != null) EntityAdded(entity); }
public virtual void Destroy(Entity e = null) { if (DestroyEvent != null) DestroyEvent(this); foreach (var component in Components.ToList()) { component.Destroy(); } }
public Emitter(Entity e, Texture2D texture, Vector2 tilesize) : base(e) { Texture = texture; TileSize = tilesize; }
public virtual void RemoveEntity(Entity entity) { //Unsubscribe from the destroy event NewEntities.Remove(entity); if (EntityRemoved != null) EntityRemoved(entity); }
public TextRender(Entity e, SpriteFont sf, string text, Vector2 position) { Entity = e; Text = text; Font = sf; }
public Weapon(Entity e) : base(e) { }
public Gun(Entity e, Texture2D bullettexture) : base(e) { BulletTexture = bullettexture; }
public virtual void AddEntity(Entity e) { if (CreateEvent != null) CreateEvent(e); }