Пример #1
0
        public CrashMove RandomCrashMove()
        {
            var random    = RandomNumber();
            var crashmove = new CrashMove[]
            {
                new Truck(),
                new Car(),
                new Motorcycle()
            };

            return(crashmove[random]);
        }
Пример #2
0
 public int Victory(CrashMove crashMove)
 {
     if (crashMove is Car)
     {
         return(Victory(crashMove as Car));
     }
     else if (crashMove is Motorcycle)
     {
         return(Victory(crashMove as Motorcycle));
     }
     else if (crashMove is Truck)
     {
         return(Victory(crashMove as Truck));
     }
     return(-2);
 }