public void AddGameObject(PlaneObject go) { if (go is BackGround) { this.BG = go as BackGround; } else if (go is PlaneHero) { this.PH = go as PlaneHero; } else if (go is HeroBullet) { heroBullets.Add(go as HeroBullet); } else if (go is PlaneEnemy) { planeEnemies.Add(go as PlaneEnemy); } else if (go is EnemyBoom) { enemyBooms.Add(go as EnemyBoom); } else if (go is EnemyBullet) { enemyBullets.Add(go as EnemyBullet); } else if (go is HeroBoom) { heroBooms.Add(go as HeroBoom); } }
public void RemoveGameObject(PlaneObject go) { if (go is PlaneEnemy) { planeEnemies.Remove(go as PlaneEnemy); } else if (go is HeroBullet) { heroBullets.Remove(go as HeroBullet); } else if (go is EnemyBoom) { enemyBooms.Remove(go as EnemyBoom); } else if (go is EnemyBullet) { enemyBullets.Remove(go as EnemyBullet); } else if (go is HeroBoom) { heroBooms.Remove(go as HeroBoom); } }