コード例 #1
0
ファイル: Driver.cs プロジェクト: TruLLi/ParadigmeProjekt
        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);
 }