Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public virtual void Destroy(Entity e = null)
 {
     if (DestroyEvent != null)
         DestroyEvent(this);
     foreach (var component in Components.ToList())
     {
         component.Destroy();
     }
 }
Exemplo n.º 3
0
 public Emitter(Entity e, Texture2D texture, Vector2 tilesize)
     : base(e)
 {
     Texture = texture;
     TileSize = tilesize;
 }
Exemplo n.º 4
0
 public virtual void RemoveEntity(Entity entity)
 {
     //Unsubscribe from the destroy event
     NewEntities.Remove(entity);
     if (EntityRemoved != null)
         EntityRemoved(entity);
 }
Exemplo n.º 5
0
 public TextRender(Entity e, SpriteFont sf, string text, Vector2 position)
 {
     Entity = e;
     Text = text;
     Font = sf;
 }
Exemplo n.º 6
0
 public Weapon(Entity e)
     : base(e)
 {
 }
Exemplo n.º 7
0
 public Gun(Entity e, Texture2D bullettexture)
     : base(e)
 {
     BulletTexture = bullettexture;
 }
Exemplo n.º 8
0
 public virtual void AddEntity(Entity e)
 {
     if (CreateEvent != null)
         CreateEvent(e);
 }