public Action aleAction() { System.Random rd = new System.Random(); int nbr = rd.Next(4); Action a; switch (nbr) { case 0: a = new AllerSauver(); break; case 1: a = new UtiliserObjet(); break; case 2: a = new PrevenirAutorite(); break; default: a = new Frapper(); break; } return(a); }
/// <summary> /// Create a plot calculated from the provided x and y functions. /// These functions must be functions of time; time goes 0 to 1 /// as the panel plots. /// </summary> /// <param name="nPoint">the number of points to plot</param> /// <param name="x">the x function</param> /// <param name="y">the y function</param> public PlotPanel2(int nPoint, Frapper x, Frapper y) { _nPoint = nPoint; points = new Point[_nPoint]; _x = x; _y = y; BackColor = Color.White; Dock = DockStyle.Fill; FindExtrema(); FindAspectRatio(); }
public Action aleAction() { System.Random rd = new System.Random(); int nbr = rd.Next(2); Action a; switch (nbr) { case 0: a = new Voler(); break; default: a = new Frapper(); break; } return(a); }