Пример #1
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is EnemyBl)
     {
         OnEnemyShot((i as EnemyBl).Etype.Points);
         OnRemove();
     }
 }
Пример #2
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is PlayerBl)
     {
         (shape as PowerUPModel).Powerup(i as PlayerBl);
     }
     OnRemove();
 }
Пример #3
0
 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();
     }
 }
Пример #4
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is PlayerBulletBl)
     {
         etype.Health -= (i as PlayerBulletBl).Damage;
         if (etype.Health <= 0)
         {
             OnDeath();
             OnRemove();
         }
     }
 }
Пример #5
0
 public void RemoveFromEntities(BusinessLogic bl)
 {
     entities.Remove(bl);
     OnRemoveObject(bl);
 }
Пример #6
0
 public void OnRemoveObject(BusinessLogic bl)
 {
     EventHandler<BusinessLogic> h = RemoveObject;
     if (h != null) h(this, bl);
 }
Пример #7
0
 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);
 }
Пример #8
0
 public abstract void Collide(BusinessLogic i, double ms);
Пример #9
0
 public void OnNewEntity(BusinessLogic b)
 {
     EventHandler<BusinessLogic> handler = NewEntity;
     if (handler != null) handler(this, b);
 }
Пример #10
0
 public void RemoveFromScene(BusinessLogic bl)
 {
     if (BL_Shape_Dict.ContainsKey(bl))
     {
         items.Remove(BL_Shape_Dict[bl]);
         BL_Shape_Dict.Remove(bl);
     }
 }
Пример #11
0
 public void AddToScene(BusinessLogic s)
 {
     GameObjectShape shape = new GameObjectShape(s.Shape);
     items.Add(shape);
     BL_Shape_Dict.Add(s, shape);
 }
Пример #12
0
 public override void Collide(BusinessLogic i, double ms)
 {
     OnRemove();
 }