Exemplo n.º 1
0
        /// <summary>
        /// runnning a car by catType
        /// </summary>
        /// <param name="carType">car</param>
        /// <returns>if catType found return true, else return false.</returns>
        public static bool RunCar(string carType)
        {
            ICar car = null;

            switch (carType)
            {
            case "FireEngine":
                car = new FireEngine();
                break;

            case "Bus":
                car = new Bus();
                break;

            case "PoliceCar":
                car = new PoliceCar();
                return(true);

            default:
                return(false);
            }

            car.Run();
            return(true);
        }
Exemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            FireEngine fireEngine = db.FireEngines.Find(id);

            db.FireEngines.Remove(fireEngine);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Id,TankVolume,Model,Mileage,PurchaseDate,WriteOffDate,Cat")] FireEngine fireEngine)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fireEngine).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fireEngine));
 }
Exemplo n.º 4
0
        public ActionResult Create([Bind(Include = "Id,TankVolume,Model,Mileage,PurchaseDate,WriteOffDate,Cat")] FireEngine fireEngine)
        {
            if (ModelState.IsValid)
            {
                db.FireEngines.Add(fireEngine);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fireEngine));
        }
Exemplo n.º 5
0
        // GET: FireEngines/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FireEngine fireEngine = db.FireEngines.Find(id);

            if (fireEngine == null)
            {
                return(HttpNotFound());
            }
            return(View(fireEngine));
        }
    private void Awake()
    {
        m_FireBike = new Bike();
        m_IceBike  = new Bike();

        m_PlayerBike  = new Bike();
        m_AndroidBike = new Bike();

        //setup Fire w/fire engine
        IEngine fireEngine = new FireEngine();
        IDriver fireDriver = new FireDriver();

        m_FireBike.SetEngine(fireEngine);
        m_FireBike.SetDriver(fireDriver);
        m_FireBike.StartEngine();

        //Setup ice w/ice engine
        IEngine iceEngine = new IceEngine();
        IDriver iceDriver = new IceDriver();

        m_IceBike.SetEngine(iceEngine);
        m_IceBike.SetDriver(iceDriver);
        m_IceBike.StartEngine();


        //Setup human w/jet engine
        IEngine jetEngine   = new JetEngine();
        IDriver humanDriver = new HumanDriver();

        m_PlayerBike.SetEngine(jetEngine);
        m_PlayerBike.SetDriver(humanDriver);
        m_PlayerBike.StartEngine();

        //Set up AI w/nitro eng
        IEngine nitroEngine   = new NitroEngine();
        IDriver androidDriver = new AndroidDriver();

        m_AndroidBike.SetEngine(nitroEngine);
        m_AndroidBike.SetDriver(androidDriver);
        m_AndroidBike.StartEngine();
    }
Exemplo n.º 7
0
        /// <summary>
        /// runnning a car by catType
        /// </summary>
        /// <param name="carType">car</param>
        /// <returns>if catType found return true, else return false.</returns>
        public static bool RunCar(string carType)
        {
            switch (carType)
            {
            case "FireEngine":
                FireEngine fire = new FireEngine();
                fire.RunFireEngine();
                return(true);

            case "Bus":
                Bus bus = new Bus();
                bus.RunBus();
                return(true);

            case "PoliceCar":
                PoliceCar police = new PoliceCar();
                police.RunPoliceCar();
                return(true);

            default:
                return(false);
            }
        }
 public FuncReturnBehavior Actor(string name, string img, string asset, string avatar, string avaasset, string layer, FireEngine.FireMLData.PositionData position)
 {
     Console.WriteLine("Actor: " + name + (img != null ? (", " + img) : ""));
     return FuncReturnBehavior.Next;
 }
 public FuncReturnBehavior ActionLayerDef(string name, FireEngine.FireMLData.PositionData position)
 {
     return FuncReturnBehavior.Next;
 }
 public bool CheckContent(string path, FireEngine.ContentInterface.ContentType expectedType)
 {
     throw new NotSupportedException();
 }