public override void Collide(BusinessLogic i, double ms) { if(i is EnemyBl) { OnEnemyShot((i as EnemyBl).Etype.Points); OnRemove(); } }
public override void Collide(BusinessLogic i, double ms) { if(i is PlayerBl) { (shape as PowerUPModel).Powerup(i as PlayerBl); } OnRemove(); }
public override void Collide(BusinessLogic i, double ms) { if ((i is EnemyBl || i is EnemyBulletBl) && (ms-lastcollision > collisionInterval)) { lastcollision = ms; Lives--; this.shape.SetXY(481 / 2, 600); if (Lives == 0) OnDeath(); } }
public override void Collide(BusinessLogic i, double ms) { if(i is PlayerBulletBl) { etype.Health -= (i as PlayerBulletBl).Damage; if (etype.Health <= 0) { OnDeath(); OnRemove(); } } }
public void RemoveFromEntities(BusinessLogic bl) { entities.Remove(bl); OnRemoveObject(bl); }
public void OnRemoveObject(BusinessLogic bl) { EventHandler<BusinessLogic> h = RemoveObject; if (h != null) h(this, bl); }
public void AddToEntities(BusinessLogic bl) { entities.Add(bl); if (bl is ICanDie) (bl as ICanDie).Death += (x, e) => HandleDeath(x as ICanDie); bl.Remove += (k, l) => RemoveFromEntities(k as BusinessLogic); OnNewObject(bl); }
public abstract void Collide(BusinessLogic i, double ms);
public void OnNewEntity(BusinessLogic b) { EventHandler<BusinessLogic> handler = NewEntity; if (handler != null) handler(this, b); }
public void RemoveFromScene(BusinessLogic bl) { if (BL_Shape_Dict.ContainsKey(bl)) { items.Remove(BL_Shape_Dict[bl]); BL_Shape_Dict.Remove(bl); } }
public void AddToScene(BusinessLogic s) { GameObjectShape shape = new GameObjectShape(s.Shape); items.Add(shape); BL_Shape_Dict.Add(s, shape); }
public override void Collide(BusinessLogic i, double ms) { OnRemove(); }