public ProjectileBalistique GetProjectileWithID(int id) { return(ListeProjectiles.Find(delegate(ProjectileBalistique proj) { return proj.ID == id; } )); }
// Checks if a projectile is active using his ID public bool IsIDActive(int ID) { bool result = ListeProjectiles.Exists(delegate(ProjectileBalistique proj) { return(proj.ID == ID); } ); return(result); }
private void CheckForProjectilesToRemove() { for (int i = ListeProjectiles.Count - 1; i >= 0; --i) { if (ListeProjectiles[i].ToRemove) { ListeProjectiles.RemoveAt(i); Soundtrack.StartSoundCue("proj_explosion"); } } }
public void CréerProjectile(Combattant combattant, Vector3 posCible, int damage, float PortéeMax) { ProjectileBalistique newProj = new ProjectileBalistique(Jeu, ScèneJeu, combattant, damage, CptProj, combattant.Position, posCible, PortéeMax, ModelName, ModelScale, Vector3.Zero); ListeProjectiles.Add(newProj); newProj.Initialize(); ++CptProj; if (combattant is Héros) { Soundtrack.StartSoundCue("proj_cast"); } }