void InitWheels() { var models = this.gameObject.GetDescendant("Model", "Wheels"); var hubs = this.gameObject.GetDescendant("Wheels"); this.wheels = new Wheels(models, hubs); }
private void GoToTopic(Wheels adv) { Browser.GoTo("http://av.by/advpublic/advpublic.php?event=Pre_Form"); var form = Browser.Form(Find.ByName("preAddForm")); form.SelectList(Find.ByName("category_parent")).SelectByValue(adv.Condition == WheelCondition.New ? "52" : "21"); form.SelectList(Find.ByName("country_id")).SelectByValue("1"); string catId; if (adv.Size.Radius < 14) { catId = "35"; } else if (adv.Size.Radius < 18) { catId = (adv.Size.Radius + 22).ToString(); } else { catId = "87"; } form.SelectList(Find.ByName("category_id")).SelectByValue(catId); form.Buttons[0].Click(); }
/// <summary> /// Initialise a trailer object /// </summary> public Trailer() { Wheelvalues = new Wheels(); AccelerationValues = new Acceleration(); WheelsConstant = new WheelsConstants(); Hook = new FVector(); }
// Navigation wicoNavigation; void ModuleProgramInit() { // wicoTravelMovement = new TravelMovement(this); //OurName = ""; //moduleName += "\nOrbital V4"; //sVersion = "4"; wicoThrusters = new WicoThrusters(this); wicoGyros = new WicoGyros(this, null); wicoGasTanks = new GasTanks(this); wicoGasGens = new GasGens(this); wicoConnectors = new Connectors(this); wicoLandingGears = new LandingGears(this); wicoCameras = new Cameras(this); wicoParachutes = new Parachutes(this); wicoNavRotors = new NavRotors(this); wicoAntennas = new Antennas(this); wicoSensors = new Sensors(this, wicoBlockMaster.GetMainController()); wicoWheels = new Wheels(this); wicoEngines = new HydrogenEngines(this); wicoPower = new PowerProduction(this); wicoOrbitalLaunch = new OrbitalModes(this); // wicoNavigation = new Navigation(this, wicoBlockMaster.GetMainController()); }
private void CalculateInfo() { string[] infoArr = { "MOT", MOT.ToString(), "Sat Nav", SatNav.ToString(), "Locked", Locked.ToString(), "Manufacturer", Manufacturer, "Model", Model, "Wheels", Wheels.ToString(), "Gears", Gears.ToString(), "Fuel Level", FuelLevel.ToString(), "Fuel Type", FuelType.ToString(), "EngineCC", Engine.EngineCC.ToString(), "Mileage", Engine.Mileage.ToString(), "Service Needed", Engine.ServiceNeeded.ToString() }; for (int i = 0; i < infoArr.Length; i++) { Info = Info + infoArr[i] + ": "; i++; Info = Info + infoArr[i] + "\n"; } }
public List <Skateboard> GetUserSkateboards(int userId) { List <Skateboard> userSkateboards = new List <Skateboard>(); using (var conn = new NpgsqlConnection(_conn)) { conn.Open(); using (var cmd = new NpgsqlCommand("SELECT * FROM skateboards WHERE user_id = (@userId);", conn)) { cmd.Parameters.AddWithValue("@userId", userId); var reader = cmd.ExecuteReader(); while (reader.Read()) { int skateboardId = int.Parse(reader["skateboard_id"].ToString()); int deckId = int.Parse(reader["deck_id"].ToString()); int wheelsId = int.Parse(reader["wheels_id"].ToString()); int truckId = int.Parse(reader["trucks_id"].ToString()); Deck deck = GetDeckById(deckId); Truck truck = GetTruckById(truckId); Wheels wheels = GetWheelsById(wheelsId); Skateboard skateboard = new Skateboard(skateboardId, userId, deck, wheels, truck); userSkateboards.Add(skateboard); } reader.Close(); } conn.Close(); } return(userSkateboards); }
public List <Skateboard> GetBoardsForLikeList() { List <Skateboard> completeSkateboards = new List <Skateboard>(); using (var conn = new NpgsqlConnection(_conn)) { conn.Open(); using (var cmd = new NpgsqlCommand("select * from skateboards WHERE deck_id != 0 AND wheels_id != 0 AND trucks_id != 0", conn)) { var reader = cmd.ExecuteReader(); while (reader.Read()) { int skateboardId = int.Parse(reader["skateboard_id"].ToString()); int userId = int.Parse(reader["user_id"].ToString()); int deckId = int.Parse(reader["deck_id"].ToString()); int wheelsId = int.Parse(reader["wheels_id"].ToString()); int truckId = int.Parse(reader["trucks_id"].ToString()); Deck deck = GetDeckById(deckId); Truck truck = GetTruckById(truckId); Wheels wheels = GetWheelsById(wheelsId); Skateboard skateboard = new Skateboard(skateboardId, userId, deck, wheels, truck); completeSkateboards.Add(skateboard); } reader.Close(); } conn.Close(); } return(completeSkateboards); }
public Wheels GetWheelsById(int id) { using (var conn = new NpgsqlConnection(_conn)) { conn.Open(); using (var cmd = new NpgsqlCommand("SELECT * FROM wheels WHERE wheels_id = (@id)", conn)) { cmd.Parameters.AddWithValue("@id", id); var reader = cmd.ExecuteReader(); while (reader.Read()) { int wheelsId = int.Parse(reader["wheels_id"].ToString()); string wheelsBrand = reader["wheels_brand"].ToString(); int wheelsSize = int.Parse(reader["wheels_size"].ToString()); string wheelsHardness = reader["wheels_hardness"].ToString(); Wheels wheels = new Wheels(wheelsId, wheelsBrand, wheelsSize, wheelsHardness); return(wheels); } reader.Close(); } conn.Close(); } return(null); }
public List <Wheels> GetAllWheels() { List <Wheels> allWheels = new List <Wheels>(); using (var conn = new NpgsqlConnection(_conn)) { conn.Open(); using (var cmd = new NpgsqlCommand("SELECT * FROM wheels", conn)) { var reader = cmd.ExecuteReader(); while (reader.Read()) { int wheelsId = int.Parse(reader["wheels_id"].ToString()); string wheelsBrand = reader["wheels_brand"].ToString(); int wheelsSize = int.Parse(reader["wheels_size"].ToString()); string wheelsHardness = reader["wheels_hardness"].ToString(); if (wheelsId != 0) { Wheels wheels = new Wheels(wheelsId, wheelsBrand, wheelsSize, wheelsHardness); allWheels.Add(wheels); } } reader.Close(); } conn.Close(); } return(allWheels); }
public Auto(FuelTank fuelTank, Engine engine, Gearbox gearbox, Wheels wheels) { this.fuelTank = fuelTank; this.engine = engine; this.gearbox = gearbox; this.wheels = wheels; }
void ModuleProgramInit() { wicoTravelMovement = new TravelMovement(this, _wicoControl); wicoThrusters = new WicoThrusters(this); wicoGyros = new WicoGyros(this, wicoBlockMaster); wicoGasTanks = new GasTanks(this, wicoBlockMaster); wicoGasGens = new GasGens(this); wicoConnectors = new Connectors(this); wicoLandingGears = new LandingGears(this); wicoCameras = new Cameras(this); wicoParachutes = new Parachutes(this); wicoNavRotors = new NavRotors(this); wicoAntennas = new Antennas(this); wicoSensors = new Sensors(this, wicoBlockMaster); wicoWheels = new Wheels(this); wicoNavigation = new Navigation(this, _wicoControl, wicoBlockMaster, wicoIGC, wicoTravelMovement, wicoGyros, wicoWheels, wicoNavRotors); _wicoControl.WantSlow(); // get updates so we can check for things like navigation commands in oldschool format /// DEBUG // wicoIGC.SetDebug(true); // _wicoControl.SetDebug(true); }
void Start() { button.GetComponent <Button>().onClick.AddListener(() => TaskOnClick()); var flatPos = transform.position; var flatCenter = GetComponent <BoxCollider>().center; var flatSize = transform.localScale; StartFlat = new SpaceForObjectAbove(flatPos.z, flatPos.y, flatSize.z * 2); startArray = new List <SpaceForObjectAbove>() { StartFlat }; //var flatsOnCorpus = new GameObject[] { Corpus.Instance.ownFlats[0], Corpus.Instance.ownFlats[1] }; CorpusThere = new ObjectOnFlat(detail, -0.5f, corpusFlats, randomPos); Weapon = new ObjectOnFlat(weapon_detail, -0.065f, new GameObject[] { }, 20); Weapon2 = new ObjectOnFlat(weapon_detail_2, 0.2f, new GameObject[] { }, 20); Details = new ObjectOnFlat[] { CorpusThere, Weapon, Weapon2 }; kolesa = new Wheels[leftWheels.Length]; for (int i = 0; i < leftWheels.Length; i++) { kolesa[i] = new Wheels(leftWheels[i], rightWheels[i], leftWheels[i].transform.position.y, leftWheels[i].transform.position.x, rightWheels[i].transform.position.x, leftWheels[i].transform.position.z); } }
public void MoveToEnd() { CarItems[WHEEL1] = new Wheels(440, 374, 10, true); CarItems[WHEEL2] = new Wheels(520, 374, 10, true); CarItems[BODY].velocity = 10; CarItems[WEAPON].velocity = 10; }
public override void Post(Wheels adv) { base.Post(adv); var subject = adv.SeasonSubject; GoToTopic(adv); var form = Browser.Form(Find.ByName("AddForm")); form.SetText("public_topic", subject); form.SetText("public_text", string.Format("{2}\n{0} {1}", adv.Description, adv.PriceText, subject)); form.SelectOption("public_period_id", "4"); form.SelectOption("city_id", "1"); if (adv.Images.Count > 0) { form.RadioButton(e => e.GetAttributeValue("name") == "upload_image" && e.GetAttributeValue("value") == "1").Checked = true; } PostPhones(form, GetPhones(adv)); form.SetCaptcha("image_security_code"); var button = form.Button(Find.ByName("send")); if (button.Exists) { button.Click(); } PostImages(adv); }
private void tabWheelsBtnConfirm_Click(object sender, RoutedEventArgs e) { string sCaption = "Build a Bike"; MessageBoxButton btnMessageBox = MessageBoxButton.OK; MessageBoxImage icnMessageBox = MessageBoxImage.Information; if (tabWheelsLstModels.SelectedIndex == -1) { MessageBox.Show("You need to select a Wheels Model", sCaption, btnMessageBox, icnMessageBox); } else { Wheels wheels = findWheels(tabWheelsLstModels.SelectedItem.ToString()); if (wheels != null) { try { bike.Wheels = wheels; wheelsCompleted = true; TextBlock header = new TextBlock(); header.Text = "Wheels"; header.Background = Brushes.LightGreen; tabWheels.Header = header; } catch (ArgumentException error) { MessageBox.Show(error.Message, sCaption, btnMessageBox, MessageBoxImage.Error); } } } }
public void displaySelectedWheels(string model) { Wheels wheels = findWheels(model); if (wheels != null) { tabWheelsTxtModel.Text = wheels.Model; tabWheelsTxtPrice.Text = "£" + wheels.Cost.ToString(); if (wheels.IsSpecialised) { tabWheelsTxtSpecialised.Text = "Specialised Component"; } else { tabWheelsTxtSpecialised.Text = "Standard Component"; } if (wheels.Availability) { tabWheelsTxtStock.Text = "In Stock!"; } else { tabWheelsTxtStock.Text = "Out of Stock"; } tabWheelsTxtDetail.Text = "Lorem ipsum dolor sit amet, dolor natoque quisque " + "dictum mattis mattis diam elit, metus nam felis elit proident felis, mauris neque eget sit eros nec neque, " + "ut nec nec. Id malesuada dui, odio proin cum eros vel quis. Mollis dictumst, nullam suscipit auctor architecto"; } }
public void FillWheelIdealQuantities(SimulatorDataSet dataSet) { DriverInfo driver = dataSet.PlayerInfo; if (driver == null || string.IsNullOrEmpty(driver.CarName)) { return; } CheckAndRetrieveIdealQuantities(driver); if (_optimalPressureFront == null && _optimalTemperatureFront == null) { return; } dataSet.SimulatorSourceInfo.TelemetryInfo.ContainsOptimalTemperatures = true; Wheels wheels = driver.CarInfo.WheelsInfo; FillWheelIdealQuantities(wheels.FrontLeft, _optimalPressureFront, _optimalTemperatureFront); FillWheelIdealQuantities(wheels.FrontRight, _optimalPressureFront, _optimalTemperatureFront); FillWheelIdealQuantities(wheels.RearLeft, _optimalPressureRear, _optimalTemperatureRear); FillWheelIdealQuantities(wheels.RearRight, _optimalPressureRear, _optimalTemperatureRear); }
static void Main(string[] args) { Engine E1 = new Engine(200, "chev", 1, true); FuelStorage F1 = new FuelStorage(20, 11.5, true); Wheel W1 = new Wheel(1, "Left back", true); Wheel W2 = new Wheel(1, "Left front", true); Wheel W3 = new Wheel(1, "Right front", false); Wheel W4 = new Wheel(1, "Right back", true); Wheels Car1 = new Wheels(); Car1.Add(W1); Car1.Add(W2); Car1.Add(W3); Car1.Add(W4); Car1.WheelsStatus(); E1.Start(F1); Creation C1 = new Creation("Chevrolet", "USA", 2001, 7); Machine M1 = new Machine(E1, F1, Car1, C1); M1.starting(E1, F1, Car1); Engine E2 = new Engine(500, "bwm", 1, true); FuelStorage F2 = new FuelStorage(25, 0, true); Wheel W5 = new Wheel(1, "Left back", true); Wheel W6 = new Wheel(1, "Left front", true); Wheel W7 = new Wheel(1, "Right front", true); Wheel W8 = new Wheel(1, "Right back", true); Wheels Car2 = new Wheels(); Car2.Add(W5); Car2.Add(W6); Car2.Add(W7); Car2.Add(W8); Car2.WheelsStatus(); E2.Start(F2); Creation C2 = new Creation("BMW", "USA", 2008, 12); Machine M2 = new Machine(E2, F2, Car2, C2); M2.starting(E2, F2, Car2); Engine E3 = new Engine(350, "mustang", 1, false); FuelStorage F3 = new FuelStorage(15, 5, true); Wheel W9 = new Wheel(1, "Left back", true); Wheel W10 = new Wheel(1, "Left front", true); Wheel W11 = new Wheel(1, "Right front", true); Wheel W12 = new Wheel(1, "Right back", true); Wheels Car3 = new Wheels(); Car3.Add(W9); Car3.Add(W10); Car3.Add(W11); Car3.Add(W12); Car3.WheelsStatus(); E3.Start(F3); Creation C3 = new Creation("Mustang", "USA", 1998, 4); Machine M3 = new Machine(E3, F3, Car3, C3); M3.starting(E3, F3, Car3); }
public virtual void Specification() { Console.WriteLine("Name:{0}", Name); Engine = _factory.CreatEngine(); PaintColor = _factory.CreatePaint(); Wheels = _factory.CreateWheels(); Console.WriteLine("Body:{0}", Body); }
/// <summary> /// sets the last calculation result of a wheel /// </summary> /// <param name="wheel">the destinated wheel</param> /// <param name="output">the last calculation result of the wheel</param> public static void SetLastCalculation(Wheels wheel, SuspensionOutput output) { int index = (int)wheel; LastCalculations[index].AccelerationTorque = output.AccelerationTorque; LastCalculations[index].WheelAngle = output.WheelAngle; LastCalculations[index].WheelLoad = output.WheelLoad; }
public virtual void Post(Wheels adv) { Settings.WaitForCompleteTimeOut = Properties.Settings.Default.WaitForCompleteTimeOut; var subject = adv.Subject; LogWriter.LogAction(string.Format("ѕубликуем объ¤вление #{0} {1}", adv.Id, subject)); }
public void RemoveWheel(GameObject wheel) { WheelCollider wheelCollider = wheel.GetComponentInChildren <WheelCollider>(); Wheels.Remove(wheelCollider); directionalWheels.Remove(wheelCollider); WheelMeshes.Remove(wheel); }
void Add(Wheels wheel) { CurrentMesh = "WheelFrontL"; Add(wheel.FrontL); CurrentMesh = "WheelFrontR"; Add(wheel.FrontR); CurrentMesh = "WheelRearL"; Add(wheel.RearL); CurrentMesh = "WheelRearR"; Add(wheel.RearR); CurrentMesh = DefaultMesh; }
public Car_Composition() { wheels = new BBC(4); //wheels = new Yamaha(); engine = new Engine(400); body = new Body("Red"); }
public BuildACar() { var wheels = new Wheels { Manufacturer = "GoodYear", size = "17", price = 195.00M }; var engien = new Engine(); var color = new Color(); var newCar = new ComposeACar(wheels, engien, color); }
public override void Post(Wheels adv) { base.Post(adv); Browser.GoTo("http://www.abw.by/index.php?act=adv&act_adv=pre_add_adventure&id_cat=4&id_sub=15"); var form = Browser.Form(Find.ByName("form1")); PostPhones(adv, form); var listRadius = form.SelectList("shina_size_id"); listRadius.Select("R" + adv.Size.Radius); form.SelectList(Find.ByName("disk_num")).SelectByValue(adv.Count.ToString()); form.TextField(Find.ByName("shina_size")).Value = adv.Size.Width.ToString(); form.TextField(Find.ByName("shina_size_2")).Value = adv.Size.Height.ToString(); form.SelectList(Find.ByName("shina_type")).SelectByValue("1"); var parts = adv.Manufacturer.Split(new char[] { '/', '|' }); if (parts.Length > 1) { form.SelectList(Find.ByName("shina_title")).Select(parts[1]); } else { form.TextField(Find.ByName("shina_model")).Value = parts[0]; } form.SelectList(Find.ByName("shina_season")).SelectByValue(GetSeasonCode(adv)); form.SelectList(Find.ByName("shina_condition_id")).SelectByValue(GetConditionCode(adv)); form.TextField(Find.ByName("price_value")).Value = (adv.Price ?? 1).ToString(); for (int i = 0; i < adv.Images.Count; i++) { var upl = form.FileUpload(Find.ByName("file" + (i + 1))); SetUploadFile(adv.Images[i], upl); } Browser.BringToFront(); form.SetCaptcha("pam"); form.Image("subbtn1").Click(); var btn = Browser.Images.FirstOrDefault(e => !string.IsNullOrWhiteSpace(e.Src) && e.Src.EndsWith("/images/but_add.gif")); if (btn != null && btn.Exists) { btn.Click(); } else { MessageBox.Show("Финальная кнопка ненайдена"); } }
/// <summary> /// sets the last calculation results of the specified wheel /// </summary> /// <param name="wheel">the destinated wheel</param> /// <param name="output">the calculation result to set</param> public static void SetWheelOutput(Wheels wheel, WheelOutput output) { int index = (int)wheel; LastCalculations[index].LongitudinalAccelerationForce = output.LongitudinalAccelerationForce; LastCalculations[index].LongitudinalDecelerationForce = output.LongitudinalDecelerationForce; LastCalculations[index].LateralAcceleration = output.LateralAcceleration; LastCalculations[index].Slip = output.Slip; LastCalculations[index].Direction = output.Direction; }
/// <summary> /// Initialise a current truck object /// </summary> public Current() { MotorValues = new Motor(); DashboardValues = new Dashboard(); LightsValues = new Lights(); WheelsValues = new Wheels(); DamageValues = new Damage(); PositionValue = new DPlacement(); AccelerationValues = new Acceleration(); }
public virtual void Update(float amount) { if (Tank.Amount > 0.0f) { float temp = Tank.PumpFuel(amount); temp = Engine.Turn(temp); temp = GearBox.Turn(temp); DistanceTraveled += Wheels.Turn(temp); } }
public void SetupDefaultWheels() { if (Chassis == null) { return; } Chassis.GetDims(out var min, out var max); var mass = Chassis.Body.Mass; var mass4 = 0.25f * mass; var axis = Vector3.Up; var spring = mass4 * _gravity / (_wheelRestingFrac * _wheelTravel); var wheelMass = 0.03f * mass; var inertia = 0.5f * (_wheelRadius * _wheelRadius) * wheelMass; var damping = 2.0f * (float)System.Math.Sqrt(spring * mass); damping *= 0.25f; damping *= _wheelDampingFrac; min.X += 3.0f * _wheelRadius; max.X -= 3.1f * _wheelRadius; min.Z += _wheelRadius * 0.35f; max.Z -= _wheelRadius * 0.35f; var delta = max - min; min.Y += _wheelZOffset; var brPos = min; var frPos = min + new Vector3(delta.X, 0.0f, 0.0f); var blPos = min + new Vector3(0.0f, 0.0f, delta.Z); var flPos = min + new Vector3(delta.X, 0.0f, delta.Z); Wheels ??= new List <Wheel>(); if (Wheels.Count == 0) { Wheels.Add(new Wheel()); Wheels.Add(new Wheel()); Wheels.Add(new Wheel()); Wheels.Add(new Wheel()); } Wheels[(int)WheelId.WheelBr].Setup(this, brPos, axis, spring, _wheelTravel, inertia, _wheelRadius, _wheelSideFriction, _wheelFwdFriction, damping, _wheelNumRays); Wheels[(int)WheelId.WheelFr].Setup(this, frPos, axis, spring, _wheelTravel, inertia, _wheelRadius, _wheelSideFriction, _wheelFwdFriction, damping, _wheelNumRays); Wheels[(int)WheelId.WheelBl].Setup(this, blPos, axis, spring, _wheelTravel, inertia, _wheelRadius, _wheelSideFriction, _wheelFwdFriction, damping, _wheelNumRays); Wheels[(int)WheelId.WheelFl].Setup(this, flPos, axis, spring, _wheelTravel, inertia, _wheelRadius, _wheelSideFriction, _wheelFwdFriction, damping, _wheelNumRays); }
public void AddWheel(Wheel wheel) { if (Wheels.Count < MaxWheels) { Wheels.Add(wheel); } else { throw new System.InvalidOperationException(string.Format("Already has {0} wheels", MaxWheels)); } }
public int CheckScore(Wheels wheels) { var combinations = from combination in this._combinations orderby combination.Score descending select combination; Wheel[] wheelsToCheck = new Wheel[] { wheels.LeftWheel, wheels.CenterWheel, wheels.RightWheel }; SymbolType[] combinationSymbolTypes = new SymbolType[3]; var sortedWheels = from wheel in wheelsToCheck orderby wheel.Symbol.SymbolType select wheel; foreach (var combination in combinations) { int combinationCount = 0; combinationSymbolTypes[0] = combination.LeftSymbol; combinationSymbolTypes[1] = combination.CenterSymbol; combinationSymbolTypes[2] = combination.RightSymbol; int combinationIndex = 0; foreach (var wheel in sortedWheels) { SymbolType combinationType = combinationSymbolTypes[combinationIndex]; combinationIndex++; if (combinationType == SymbolType.Nothing || wheel.Symbol.SymbolType == combinationType) { if (wheel.Symbol.SymbolType == combinationType) { wheel.GivesScore = true; } combinationCount++; } } if (combinationCount == 3) { return combination.Score; } else { foreach (Wheel wheel in wheelsToCheck) { wheel.GivesScore = false; } } } return 0; }
public void SetWheels(Wheels wheels) { _car.Wheels = wheels; }