private void Awake() { IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); IEngine nitroEngine = new NitroEngine(); IDriver AIDriver = new AndroidDriver(); m_AIBike.SetEngine(nitroEngine); m_AIBike.SetDriver(AIDriver); m_AIBike.StartEngine(); IEngine lawnMowerEngine = new LawnMowerEngine(); IDriver redneckDriver = new RedneckDriver(); m_RedneckBike.SetEngine(lawnMowerEngine); m_RedneckBike.SetDriver(redneckDriver); m_RedneckBike.StartEngine(); IEngine handCrankEngine = new HandCrankEngine(); IDriver marioDriver = new MarioDriver(); m_MarioBike.SetEngine(handCrankEngine); m_MarioBike.SetDriver(marioDriver); m_MarioBike.StartEngine(); }
void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); //m_PlayerBike.StartEngine(); // Set up a bike with an android AI driver and a nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidBike.SetEngine(nitroEngine); m_AndroidBike.SetDriver(androidDriver); //m_AndroidBike.StartEngine(); // Set up a bike with an alien AI driver and a solar engine IEngine solarEngine = new SolarEngine(); IDriver alienDriver = new AlienDriver(); m_AlienBike.SetEngine(solarEngine); m_AlienBike.SetDriver(alienDriver); //m_AlienBike.StartEngine(); // Set up a bike with a golem driver and an anchient engine IEngine anchientEngine = new AnchientEngine(); IDriver golemDriver = new GolemDriver(); m_GolemBike.SetEngine(anchientEngine); m_GolemBike.SetDriver(golemDriver); // m_GolemBike.StartEngine(); }
void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); // Set up these bikes with a AI driver and a different engines IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidBike1.SetEngine(nitroEngine); m_AndroidBike1.SetDriver(androidDriver); m_AndroidBike1.StartEngine(); IEngine oilEngine = new OrganicFryOilEngine(); IDriver androidDriver2 = new AndroidDriver2(); m_AndroidBike2.SetEngine(oilEngine); m_AndroidBike2.SetDriver(androidDriver2); m_AndroidBike2.StartEngine(); IEngine teslaEngine = new TeslaEngine(); IDriver androidDriver3 = new AndroidDriver3(); m_AndroidBike3.SetEngine(teslaEngine); m_AndroidBike3.SetDriver(androidDriver3); m_AndroidBike3.StartEngine(); }
public string CreateBoatEngine(string model, int horsepower, int displacement, EngineType engineType) { IBoatEngine engine; switch (engineType) { case EngineType.Jet: engine = new JetEngine(model, horsepower, displacement); break; case EngineType.Sterndrive: engine = new SterndriveEngine(model, horsepower, displacement); break; default: throw new NotImplementedException(); } this.Database.Engines.Add(engine); return(string.Format( "Engine model {0} with {1} HP and displacement {2} cm3 created successfully.", model, horsepower, displacement)); }
void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); // Set up a bike with an AI driver and a nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidBike.SetEngine(nitroEngine); m_AndroidBike.SetDriver(androidDriver); m_AndroidBike.StartEngine(); // Set up a bike with an AI vampire and a gear engine IEngine gearEngine = new GearEngine(); IDriver vampireDriver = new VampireDriver(); m_VampireBike.SetEngine(gearEngine); m_VampireBike.SetDriver(vampireDriver); m_VampireBike.StartEngine(); // Set up a bike with an AI monster and a monster engine IEngine monsterEngine = new MonsterEngine(); IDriver monsterDriver = new MonsterDriver(); m_MonsterBike.SetEngine(monsterEngine); m_MonsterBike.SetDriver(monsterDriver); m_MonsterBike.StartEngine(); }
void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerPlane.SetEngine(jetEngine); m_PlayerPlane.SetDriver(humanDriver); m_PlayerPlane.StartEngine(); // Set up a bike with a AI driver and a nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidPlane.SetEngine(nitroEngine); m_AndroidPlane.SetDriver(androidDriver); m_AndroidPlane.StartEngine(); // Set up a bike with a alien driver and a world engine IEngine worldEngine = new WorldEngine(); IDriver alienDriver = new AlienDriver(); m_AlienPlane.SetEngine(worldEngine); m_AlienPlane.SetDriver(alienDriver); m_AlienPlane.StartEngine(); // Set up a bike with a chicken driver and a hydro engine IEngine hydroEngine = new HydroEngine(); IDriver chickenDriver = new ChickenDriver(); m_ChickenPlane.SetEngine(hydroEngine); m_ChickenPlane.SetDriver(chickenDriver); m_ChickenPlane.StartEngine(); }
void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); // Set up a bike with a AI driver and a nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_PlayerBike.SetEngine(nitroEngine); m_PlayerBike.SetDriver(androidDriver); m_PlayerBike.StartEngine(); // Set up a bike with an Evan Driver and Photon Engine IEngine photonEngine = new PhotonicEngine(); IDriver evanDriver = new EvanDriver(); m_PlayerBike.SetEngine(photonEngine); m_PlayerBike.SetDriver(evanDriver); m_PlayerBike.StartEngine(); // Set up a bike with an Evan Driver and Photon Engine IEngine warpEngine = new WarpEngine(); IDriver starshipDriver = new StarshipDriver(); m_PlayerBike.SetEngine(warpEngine); m_PlayerBike.SetDriver(starshipDriver); m_PlayerBike.StartEngine(); }
public void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); // Set up a bike with an AI driver and a nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidBike.SetEngine(nitroEngine); m_AndroidBike.SetDriver(androidDriver); m_AndroidBike.StartEngine(); // Set up a bike with an AI driver and a slime engine IEngine slimeEngine = new SlimeEngine(); IDriver gooBallDriver = new GooBallDriver(); m_GooBallBike.SetEngine(slimeEngine); m_GooBallBike.SetDriver(gooBallDriver); m_GooBallBike.StartEngine(); // Set up a bike with an AI driver and a feather engine IEngine featherEngine = new FeatherEngine(); IDriver pigeonDriver = new PigeonDriver(); m_PigeonBike.SetEngine(featherEngine); m_PigeonBike.SetDriver(pigeonDriver); m_PigeonBike.StartEngine(); }
// Start is called before the first frame update void Awake() { IEngine jetEngine = new JetEngine(); IDriver human = new HumanDriver(); playerBike.SetEngine(jetEngine); playerBike.SetDriver(human); playerBike.StartEngine(); IEngine nitroEngine = new NitroEngine(); IDriver aiOne = new AIDriver(); AIBikeOne.SetEngine(nitroEngine); AIBikeOne.SetDriver(aiOne); AIBikeOne.StartEngine(); IEngine warpEngine = new WarpEngine(); IDriver aiTwo = new AIDriver(); AIBikeTwo.SetEngine(warpEngine); AIBikeTwo.SetDriver(aiTwo); AIBikeTwo.StartEngine(); IEngine hyperDrive = new Hyperdrive(); IDriver aiThree = new AIDriver(); AIBikeThree.SetEngine(hyperDrive); AIBikeThree.SetDriver(aiThree); AIBikeThree.StartEngine(); }
private void Awake() { //Human driver with jet engine bike IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); //Android driver with nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidBike.SetEngine(nitroEngine); m_AndroidBike.SetDriver(androidDriver); m_AndroidBike.StartEngine(); //Fish driver with wood engine IEngine woodEngine = new WoodEngine(); IDriver fishDriver = new FishDriver(); m_FishBike.SetEngine(woodEngine); m_FishBike.SetDriver(fishDriver); m_FishBike.StartEngine(); //Mirror driver with coal engine IEngine coalEngine = new CoalEngine(); IDriver mirrorDriver = new MirrorDriver(); m_MirrorBike.SetEngine(coalEngine); m_MirrorBike.SetDriver(mirrorDriver); m_MirrorBike.StartEngine(); }
private bool CompactDB(string srcDB, string dstDB, string pass) { try { string sourceConnection = string.Concat(new string[] { "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=", srcDB, "; Jet OLEDB:Database Password="******";" }); string destconnection = string.Concat(new string[] { "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=", dstDB, "; Jet OLEDB:Database Password="******";" }); JetEngine jetEngine = (JetEngine)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("DE88C160-FF2C-11D1-BB6F-00C04FAE22DA"))); jetEngine.CompactDatabase(sourceConnection, destconnection); return(true); } catch (Exception) { } return(false); }
private void Awake() { IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); mPlayerBike.SetEngine(jetEngine); mPlayerBike.SetDriver(humanDriver); mPlayerBike.StartEngine(); IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); mAndroidBike.SetEngine(nitroEngine); mAndroidBike.SetDriver(androidDriver); mAndroidBike.StartEngine(); IEngine rocketEngine = new RocketEngine(); IDriver alienDriver = new AlienDriver(); mAlienBike.SetEngine(rocketEngine); mAlienBike.SetDriver(alienDriver); mAlienBike.StartEngine(); IEngine steamEngine = new SteamEngine(); IDriver steampunkDriver = new SteampunkDriver(); mSteampunkBike.SetEngine(steamEngine); mSteampunkBike.SetDriver(steampunkDriver); mSteampunkBike.StartEngine(); }
void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); // Set up a bike with a AI driver and a nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidBike.SetEngine(nitroEngine); m_AndroidBike.SetDriver(androidDriver); m_AndroidBike.StartEngine(); // Bike with Electric Engine and Charlie Brown's dog as your driver IEngine ElectricEngine = new ElectricEngine(); IDriver SnoopyDriver = new SnoopyDriver(); m_AndroidBike.SetEngine(ElectricEngine); m_AndroidBike.SetDriver(SnoopyDriver); m_AndroidBike.StartEngine(); //Bike with combustion engine and a Disney Dapper Dan as your driver IEngine CombustionEngine = new NitroEngine(); IDriver DapperDanDriver = new AndroidDriver(); m_AndroidBike.SetEngine(CombustionEngine); m_AndroidBike.SetDriver(DapperDanDriver); m_AndroidBike.StartEngine(); }
public void CheckThatAddingRestrictorCallsObserver() { var restrictor = new JetEngine(mockBlock.Object, EdgeType.LEFT); blueprintBuilder.AddRestrictor(restrictor); mockBlueprintBuilderObserver.Verify(obs => obs.RestrictorAdded(It.IsAny <IBlueprintBuilder>(), restrictor), Times.Once()); }
public void CheckIfAdditionalSetupsTriesToAddJetEngineToBlueprintBuilderBlockRestrictorList() { jetEngine = new JetEngine(mockBlock.Object, edgeTypeColumn); jetEngine.AdditionalSetups(mockBlueprintBuilder.Object); mockBlueprintBuilder.Verify(x => x.AddRestrictor(jetEngine), Times.Once()); }
public void CheckIfRemoveAdditionalSetupsTriesToDeleteJetEngineFromBlueprintBuilderBlockRestrictorList() { jetEngine = new JetEngine(mockBlock.Object, edgeTypeColumn); jetEngine.RemoveAdditionalSetups(mockBlueprintBuilder.Object); mockBlueprintBuilder.Verify(x => x.RemoveRestrictor(jetEngine), Times.Once()); }
public void CheckIfCanCreateBlockIfBlockToBeCreatedOnTheSameLineOutsideJetRange() { jetEngine = new JetEngine(mockBlock.Object, edgeTypeLine); var newBlockPosition = new Coordinate(6, 5); mockBlock.SetupGet(x => x.Position).Returns(new Coordinate(4, 5)); Assert.IsTrue(jetEngine.CanCreateBlock(newBlockPosition)); }
public void CheckThatBlockCannotBeCreatedIfBlockToBeCreatedIsWithinJetRangeOnTheSameColumn() { jetEngine = new JetEngine(mockBlock.Object, edgeTypeColumn); var newBlockPosition = new Coordinate(4, 6); mockBlock.SetupGet(x => x.Position).Returns(new Coordinate(4, 5)); Assert.IsFalse(jetEngine.CanCreateBlock(newBlockPosition)); }
sealed public override void Operation(RobotBase operatingRobotBase) { JetEngine jetEngine = operatingRobotBase.GetRobotPart <JetEngine>(); if (jetEngine != null) { jetEngine.EnginePower = Input1.GetReporterNumberValue(operatingRobotBase); } }
sealed public override void Operation(RobotBase operatingRobotBase) { JetEngine jetEngine = operatingRobotBase.GetRobotPart <JetEngine>(); if (jetEngine != null) { jetEngine.Destination = new Vector2(Input1.GetReporterNumberValue(operatingRobotBase), Input2.GetReporterNumberValue(operatingRobotBase)); } }
public void CheckThatJetEngineCannotBePlacedOnLineIfInterferingBlocksExist() { jetEngine = new JetEngine(mockBlock.Object, edgeTypeLine); var position = new Coordinate(4, 5); var existing = new Coordinate(2, 5); mockBlueprint.SetupGet(x => x.Dimensions).Returns(new Coordinate(10, 11)); mockBlueprint.Setup(x => x.HasBlock(existing)).Returns(true); Assert.IsFalse(jetEngine.CanBePlaced(mockBlueprint.Object, position)); }
public void AirplaneNoNinject() { AerialVehicle ap; JetEngine je; je = new JetEngine(); ap = new Airplane(je); Assert.IsInstanceOfType(ap, typeof(AerialVehicle)); Assert.IsInstanceOfType(ap, typeof(Airplane)); Assert.IsInstanceOfType(ap.Engine, typeof(Engine)); Assert.AreEqual("This is an Engine of a Commerical level passenger Jet that is meant to travel across large distances.", ap.Engine.About()); }
public override string GetReporterStringValue(RobotBase operatingRobotBase) { JetEngine jetEngine = operatingRobotBase.GetRobotPart <JetEngine>(); if (jetEngine != null) { return(jetEngine.EnginePower.ToString()); } else { return(System.String.Empty); } }
public void CheckThatJetEngineCanBePlacedIfItDoesntInterfereWithAnyBlocks() { jetEngine = new JetEngine(mockBlock.Object, edgeTypeColumn); var position = new Coordinate(4, 5); var existingOnColumn = new Coordinate(4, 4); var existingOnLine = new Coordinate(6, 5); mockBlueprint.SetupGet(x => x.Dimensions).Returns(new Coordinate(10, 11)); mockBlueprint.Setup(x => x.HasBlock(existingOnColumn)).Returns(true); mockBlueprint.Setup(x => x.HasBlock(existingOnLine)).Returns(true); Assert.IsTrue(jetEngine.CanBePlaced(mockBlueprint.Object, position)); }
public static void CompactJetDatabase(string fileName) { // I use this function as part of an AJAX page, so rather // than throwing exceptions if errors are encountered, I // simply return false and allow the page to handle the // failure generically. try { // Find the database on the web server string oldFileName = fileName; // JET will not compact the database in place, so we // need to create a temporary filename to use string newFileName = Path.Combine(Path.GetDirectoryName(oldFileName), Guid.NewGuid().ToString("N") + ".mdb"); // Obtain a reference to the JET engine JetEngine engine = (JetEngine)HttpContext.Current.Server.CreateObject( "JRO.JetEngine"); // Compact the database (saves the compacted version to // newFileName) engine.CompactDatabase( String.Format( AccessOleDbConnectionStringFormat, oldFileName), String.Format( AccessOleDbConnectionStringFormat, newFileName)); // Delete the original database File.Delete(oldFileName); // Move (rename) the temporary compacted database to // the original filename File.Move(newFileName, oldFileName); // The operation was successful } catch (Exception ex) { // We encountered an error MessageBox.Show("Greska : " + ex.Message); } }
/// <summary> /// Оптимизирует базу данных текущего года /// посредством удаления устаревших данных /// и последующего сжатия файла базы данных. /// </summary> public static void Optimize() { Load(Connection); Tables.Optimize(); Clear(); // Сжатие базы данных string tempPath = Path.Combine(_DataDirectory.FullName, "temp.mdb"); _ConnectionStringBuilder.DataSource = tempPath; JRO.JetEngine jro = new JetEngine(); jro.CompactDatabase(Connection.ConnectionString, _ConnectionStringBuilder.ConnectionString); File.Delete(Connection.DataSource); File.Copy(tempPath, Connection.DataSource); File.Delete(tempPath); }
public static bool CompactAndRepair() { try { JetEngine engine = new JetEngine(); engine.CompactDatabase(connectionString, tempConnectionString); File.Delete(DBPath); File.Move(DBPath, DBPath); Console.WriteLine("Database successfully Repaired and Compacted\n"); return(true); } catch (Exception ex) { Console.WriteLine("Database failed to Repair and Compact\n" + ex.ToString()); } return(false); }
void Awake() { // Set up a bike with a human driver and jet engine IEngine jetEngine = new JetEngine(); IDriver humanDriver = new HumanDriver(); m_PlayerBike.SetEngine(jetEngine); m_PlayerBike.SetDriver(humanDriver); m_PlayerBike.StartEngine(); // Set up a bike with a AI driver and a nitro engine IEngine nitroEngine = new NitroEngine(); IDriver androidDriver = new AndroidDriver(); m_AndroidBike.SetEngine(nitroEngine); m_AndroidBike.SetDriver(androidDriver); m_AndroidBike.StartEngine(); }
//压缩数据库 public void compressDB_B(ToolStripStatusLabel label, string db_Pwd) { try { JetEngine x = new JetEngine(); string connstr = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}\source\StuContact.mdb;Jet OLEDB:Database Password='******'", Application.StartupPath, db_Pwd); string connstr1 = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}\source\StuContact1.mdb;Jet OLEDB:Database Password='******'", Application.StartupPath, db_Pwd); x.CompactDatabase(connstr, connstr1); File.Delete(Application.StartupPath + "\\source\\StuContact.mdb"); File.Move(Application.StartupPath + "\\source\\StuContact1.mdb", Application.StartupPath + "\\source\\StuContact.mdb"); MessageBox.Show("数据库压缩成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); refresh_DB(label);//调用方法刷新数据库大小显示 } catch (Exception ex) { MessageBox.Show(ex.Message, "出错提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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(); }
/// <summary> /// Creates a new boat engine and adds it to the database. /// </summary> /// <param name="model"> Engine manufacturer model </param> /// <param name="horsepower"> Engine power (in HP) </param> /// <param name="displacement"> Engine displacement (water draught) </param> /// <param name="engineType"> Engine type (Jet or Sterndrive)</param> /// <returns> A view with information about the outcome of the operation </returns> public string CreateBoatEngine(string model, int horsepower, int displacement, EngineType engineType) { IBoatEngine engine; switch (engineType) { case EngineType.Jet: engine = new JetEngine(model, horsepower, displacement); break; case EngineType.Sterndrive: engine = new SterndriveEngine(model, horsepower, displacement); break; default: throw new NotImplementedException(); } this.Database.Engines.Add(engine); return string.Format( "Engine model {0} with {1} HP and displacement {2} cm3 created successfully.", model, horsepower, displacement); }