Пример #1
0
    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);
    }
Пример #2
0
 /// <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();
 }
Пример #3
0
    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);
    }