コード例 #1
0
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is EnemyBl)
     {
         OnEnemyShot((i as EnemyBl).Etype.Points);
         OnRemove();
     }
 }
コード例 #2
0
ファイル: PowerUPBl.cs プロジェクト: cregz/shmup-beadando
 public override void Collide(BusinessLogic i, double ms)
 {
     if(i is PlayerBl)
     {
         (shape as PowerUPModel).Powerup(i as PlayerBl);
     }
     OnRemove();
 }
コード例 #3
0
ファイル: PlayerBl.cs プロジェクト: cregz/shmup-beadando
 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
ファイル: EnemyBl.cs プロジェクト: cregz/shmup-beadando
 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
ファイル: Game.cs プロジェクト: cregz/shmup-beadando
 public void RemoveFromEntities(BusinessLogic bl)
 {
     entities.Remove(bl);
     OnRemoveObject(bl);
 }
コード例 #6
0
ファイル: Game.cs プロジェクト: cregz/shmup-beadando
 public void OnRemoveObject(BusinessLogic bl)
 {
     EventHandler<BusinessLogic> h = RemoveObject;
     if (h != null) h(this, bl);
 }
コード例 #7
0
ファイル: Game.cs プロジェクト: cregz/shmup-beadando
 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
ファイル: BusinessLogic.cs プロジェクト: cregz/shmup-beadando
 public abstract void Collide(BusinessLogic i, double ms);
コード例 #9
0
ファイル: StageLogic.cs プロジェクト: cregz/shmup-beadando
 public void OnNewEntity(BusinessLogic b)
 {
     EventHandler<BusinessLogic> handler = NewEntity;
     if (handler != null) handler(this, b);
 }
コード例 #10
0
ファイル: ViewModel.cs プロジェクト: cregz/shmup-beadando
 public void RemoveFromScene(BusinessLogic bl)
 {
     if (BL_Shape_Dict.ContainsKey(bl))
     {
         items.Remove(BL_Shape_Dict[bl]);
         BL_Shape_Dict.Remove(bl);
     }
 }
コード例 #11
0
ファイル: ViewModel.cs プロジェクト: cregz/shmup-beadando
 public void AddToScene(BusinessLogic s)
 {
     GameObjectShape shape = new GameObjectShape(s.Shape);
     items.Add(shape);
     BL_Shape_Dict.Add(s, shape);
 }
コード例 #12
0
ファイル: EnemyBulletBl.cs プロジェクト: cregz/shmup-beadando
 public override void Collide(BusinessLogic i, double ms)
 {
     OnRemove();
 }