public RoundTests() { generator = new NumberGenerator(); wheel = new Wheel(generator); round = new Round(wheel, 30); expected = new Result(Color.Black, 10); }
private const double AerodynamicResistanceForce = 250; // N public Car(double weight, IEngine engine, IGearTransmissionBox gearbox, IWheel wheel) { Wheel = wheel; Weight = weight; this.engine = engine; this.gearbox = gearbox; }
public Porsche(IWheelFactory wheelFactory) { WheelFrontLeft = wheelFactory.Create("Front-Left"); WheelFrontRight = wheelFactory.Create("Front-Right"); WheelRearLeft = wheelFactory.Create("Rear-Left"); WheelRearRight = wheelFactory.Create("Rear-Right"); }
public SocketServer(IWheel wheel, IUltrasonic ultrasonic, ILidarDistance lidar, IEncoders encoders, ExampleLogicService exampleLogicService, StudentLogicService studentLogicService) { _requestHandler = new RequestHandler(wheel, ultrasonic, lidar, encoders, exampleLogicService, studentLogicService); _wheel = wheel; Error = new Error(); PortNumber = "51915"; }
public FourWheelAcceleration(IWheel frontLeft, IWheel frontRight, IWheel rearLeft, IWheel rearRight) { _frontLeft = frontLeft; _frontRight = frontRight; _rearLeft = rearLeft; _rearRight = rearRight; }
public EndGameDialog(IWheel wheel) { InitializeComponent(); lbl_Outcome.Text = $@"{wheel.GetCurrentPlayer()} successfully solved the phrase:""{wheel.GetCurrentPhrase()}"""; var sortedPlayers = wheel.GetAllPlayers().ToList().OrderByDescending(p => p.Score).ToList(); for (int i = 1; i <= sortedPlayers.Count; i++) { switch (i) { case 1: lbl_Player1.Text = $@"Winner: {sortedPlayers[i-1]} - {sortedPlayers[i-1].Score:C0}"; lbl_Player1.Visible = true; break; case 2: lbl_Player2.Text = $@"2nd Place: {sortedPlayers[i-1]} - {sortedPlayers[i-1].Score:C0}"; lbl_Player2.Visible = true; break; case 3: lbl_Player3.Text = $@"3rd Place: {sortedPlayers[i-1]} - {sortedPlayers[i-1].Score:C0}"; lbl_Player3.Visible = true; break; case 4: lbl_Player4.Text = $@"4th Place: {sortedPlayers[i-1]} - {sortedPlayers[i-1].Score:C0}"; lbl_Player4.Visible = true; break; } } }
public void SetUp() { _player = new Player(); _fakeCaptureInput = new FakeInputUtils(); _puzzle = new Puzzle(new FakePhraseGenerator()); _wheel = new FakeWheel(); }
public bool EditWheel(IWheel wheel, IWheelElements elements) { WheelEditorForm form = new WheelEditorForm(wheel, elements); if (form.ShowDialog() == DialogResult.OK) { wheel.Label = form.Label; wheel.AccentColor = form.AccentColor; wheel.BgColor = form.BgColor; if (form.IsStartup) { elements.StartupWheel = wheel; } if (wheel.Buttons != null) { foreach (IWheelButton button in form.Buttons) { if (!wheel.Buttons.Remove(button)) { elements.Buttons.Add(button); } } foreach (IWheelButton button in wheel.Buttons) { elements.Buttons.Remove(button); } } wheel.Buttons = form.Buttons; return(true); } return(false); }
public FourWheelSteering(IWheel frontLeft, IWheel frontRight, IWheel rearLeft, IWheel rearRight) { _frontLeft = frontLeft; _frontRight = frontRight; _rearLeft = rearLeft; _rearRight = rearRight; }
private void InitFields() { _transform = transform; try { _pirate = GetComponent <IPirate>(); } catch { throw new NullReferenceException("No component that implements the IFactoryLevel interface was found."); } try { _wheel = _spaceshipWheel.GetComponent <IWheel>(); } catch { throw new NullReferenceException("Wheel field must not be null."); } try { _motor = _spaceshipMotor.GetComponent <IMotor>(); } catch { throw new NullReferenceException("No component that implements the IMotor interface was found."); } }
public Round(IWheel wheel, int roundTime) { _wheel = wheel; TimeLeft = roundTime; roundTimer = new Timer(1000); roundTimer.Elapsed += RoundTimer_Elapsed; }
public RouletteGame(IWheel wheel, ITableLoader tableLoader) { _wheel = wheel; _tableLoader = tableLoader; LoadTable(); }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { var year = pattern.Trim(' ').Replace("DOT", " "); int convertedYear = AWheelOperations.GetIntegerFromString(year); wheel.DotNumber = convertedYear; return wheel; }
public WheelViewModel(IWheel Wheel) { this.Wheel = Wheel; this.Speed = Wheel.Speed; //this.Milage = Wheel.Milage; //Wheel.MilageChanged += (Sender, Args) => this.Milage = Wheel.Milage; }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { var splittet = pattern.Split('/'); wheel.WheelWidth = AWheelOperations.GetIntegerFromString(splittet[0]); wheel.WheelHeight = AWheelOperations.GetIntegerFromString(splittet[1]); return wheel; }
/// <summary> /// Removes the given item from the collection /// </summary> /// <returns>True, if the item was removed, otherwise False</returns> /// <param name="item">The item that should be removed</param> public virtual bool Remove(BikeShop.BicycleChallenge.IComponent item) { if ((this._parent.Frame == item)) { this._parent.Frame = null; return(true); } if ((this._parent.Fork == item)) { this._parent.Fork = null; return(true); } IWheel wheelItem = item.As <IWheel>(); if (((wheelItem != null) && this._parent.Wheels.Remove(wheelItem))) { return(true); } if ((this._parent.HandleBar == item)) { this._parent.HandleBar = null; return(true); } return(false); }
public CarWorld(ICarFactory carFactory) { _carFactory = carFactory; _engine = _carFactory.CreateEngine(); _chassis = _carFactory.CreateChassis(); _wheel = _carFactory.CreateWheel(); }
public PowerViewModel(ILidarDistance lidar, IWheel wheel, IEncoders encoders, IUltrasonic ultrasonic) { Lidar = lidar; Wheel = wheel; Encoders = encoders; Ultrasonic = ultrasonic; }
public void Execute() { SelectCarType(); Brand brand = SelectBrand(); SelectColour(); IColourDecoration colourDecoration = SelectColourDeco(); EngineClass engine = SelectEngine(); SelectWheel(); IWheelDeco wheelDeco = SelectWheelDeco(); Numberplate numberplate = AssignNumberplate(); IWheel wheel = (IWheel)Activator.CreateInstance(wheelList[listOfIndex.Last()], wheelDeco); listOfIndex.RemoveAt(listOfIndex.Count - 1); ICarColour carColour = (ICarColour)Activator.CreateInstance(carColourList[listOfIndex.Last()], colourDecoration); listOfIndex.RemoveAt(listOfIndex.Count - 1); Vehicle vehicle = (Vehicle)Activator.CreateInstance(types[listOfIndex.Last()], new object[] { carColour, wheel, brand, numberplate, engine }); Console.WriteLine("Congratulation you successfully added a new vehicle"); carDealer.AddVehicleToList(vehicle); command = new PrintVehicleCommand() { List = carDealer.Vehicles }; command.Execute(); listOfIndex.Clear(); }
public void Init() { // Assume sut = new Wheel(18 * 2.54 / 2) { Pressure = 2.0 }; }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { var splittet = pattern.Split('/'); wheel.WheelWidth = AWheelOperations.GetIntegerFromString(splittet[0]); wheel.WheelHeight = AWheelOperations.GetIntegerFromString(splittet[1]); return(wheel); }
public RoomTests() { generator = new NumberGenerator(); wheel = new Wheel(generator); room = new Room("Speed roulette", TestFactory.CreateTestRoomDAL()); player = new User("test", TestFactory.CreateTestUserDAL()); round = new Round(wheel, 30); }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { var year = pattern.Trim(' ').Replace("DOT", " "); int convertedYear = AWheelOperations.GetIntegerFromString(year); wheel.DotNumber = convertedYear; return(wheel); }
public VehicleType(IVehicle v, Point3d emittionPt, Vector3d initialVelocity, AbstractEnvironmentType environment) : base(v, emittionPt, initialVelocity, environment) { WheelRadius = v.WheelRadius; Wheels = new IWheel[2]; Wheels[(int)WheelPositions.LeftRear] = new Wheel(GetWheelPosition(BodySize, RS.HALF_PI), WheelRadius, 0); Wheels[(int)WheelPositions.RightRear] = new Wheel(GetWheelPosition(BodySize, -RS.HALF_PI), WheelRadius, 0); }
/// <summary> /// The RoundFlow. /// </summary> /// <param name="wheel">The wheel<see cref="IWheel"/>.</param> /// <param name="maxNumberOfRounds">The maxNumberOfRounds<see cref="int"/>.</param> public void RoundFlow(IWheel wheel, int maxNumberOfRounds) { this.SetNumberOfRounds(maxNumberOfRounds); var currentPlayer = LLPlayers.First; while (this.RoundNumber != this.NumberOfRounds) { if (!Console.IsOutputRedirected) { Console.Clear(); } Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine($"\nPlayers! Get ready for round {this.RoundNumber + 1}\n"); Console.ResetColor(); var puzzle = new Puzzle(this.PhraseGenerator); Players.ForEach(player => player.RoundScore.Reset()); Console.WriteLine("GAME SCORE:"); Players.ForEach(player => Console.Write($"{player.Name}: ${player.GameScore.GetBalance()} | ")); Console.WriteLine("\n"); Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("Here's your puzzle:"); Console.ResetColor(); bool successfulSolve = puzzle.IsSolved(); while (!successfulSolve) { bool successfulGuess = true; while (successfulGuess && !successfulSolve) { successfulGuess = Turn.HandleTurn(currentPlayer.Value, puzzle, this.CaptureInput, wheel); successfulSolve = puzzle.IsSolved(); } ; if (!successfulSolve) { currentPlayer = currentPlayer.Next ?? LLPlayers.First; } } this.IncrementRound(); } Console.WriteLine("GAME SCORE"); Players.ForEach(player => Console.Write($"{player.Name}: ${player.GameScore.GetBalance()} | ")); Console.WriteLine("\n"); Player winner = Players.Aggregate((p1, p2) => p1.GameScore.GetBalance() > p2.GameScore.GetBalance() ? p1 : p2); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"Congrats {winner.Name}, you won the game with ${winner.GameScore.GetBalance()}!\n"); Console.ResetColor(); throw new ApplicationException(); }
public EquipmentOverviewViewModel(IUltrasonic ultrasonic, ILidarDistance lidar, IWheel wheel, IEncoders encoders, ExampleLogicService exampleLogic, StudentLogicService studentLogic) { Ultrasonic = ultrasonic; Lidar = lidar; Wheel = wheel; Encoders = encoders; ExampleLogic = exampleLogic; StudentLogic = studentLogic; }
public void Wheel_SetSpeed_OverspeedReverse() { left = new Wheel(PinPwm, PinFwd, PinRev); left.SetSpeed(-150); Assert.False(left.Forward); Assert.True(left.Reverse); Assert.Equal(-100, left.Speed); }
public void Wheel_SetSpeed_Stop() { yomo.Utility.Settings.Testing = true; left = new Wheel(PinPwm, PinFwd, PinRev); left.SetSpeed(0); Assert.False(left.Forward); Assert.False(left.Reverse); }
public IPropertyExtractor GetPropertyExtractor(IArticle article) { IWheel wheel = article as IWheel; if (wheel != null) { return(GetPropertyExtractor(wheel)); } return(new PrestoshopPropertyExtractor(article, marge)); }
public BlokEmulationParameters(IPathRiderProvider PathRiderProvider, IWheel Wheel) { Observable.FromEvent(a => Wheel.SpeedChanged += (s, e) => a(), a => { }) .Select(_ => Wheel.Speed) .ToProperty(this, x => x.Speed, out _speed); PathRiderProvider.PathRider .CombineLatest(Wheel.Milage, (rider, milage) => rider.PointAt(milage)) .ToProperty(this, x => x.Position, out _position); }
private void Item_UpClick(object sender, EventArgs e) { IWheel movedWheel = (IWheel)((ElementListItem)sender).Element; if (elements.Wheels[0] == movedWheel) { return; } elements.Wheels.MoveElement(movedWheel, -1); UpdateWheelsList(); }
public WheelPlaceholderReplacer(IWheel article) : base(article) { replaceMap.Add(Placeholder.WheelPlaceholder.WheelHeightPlaceholder, article.WheelHeight.ToString(CultureInfo.InvariantCulture)); replaceMap.Add(Placeholder.WheelPlaceholder.WheelWidthPlaceholder, article.WheelWidth.ToString(CultureInfo.InvariantCulture)); replaceMap.Add(Placeholder.WheelPlaceholder.WheelNamePlaceholder, article.WheelId); replaceMap.Add(Placeholder.WheelPlaceholder.WheelEuImageLink, article.TyreLabelLink); replaceMap.Add(Placeholder.WheelPlaceholder.WheelLoadIndex, article.WeightIndex.ToString(CultureInfo.InvariantCulture)); replaceMap.Add(Placeholder.WheelPlaceholder.WheelSpeedIndex, article.SpeedIndex.ToString(CultureInfo.InvariantCulture)); replaceMap.Add(Placeholder.WheelPlaceholder.WheelCrossSectionPlaceholder, article.CrossSection); replaceMap.Add(Placeholder.WheelPlaceholder.WheelType, GetWheelType(article)); }
public ShellViewModel(INavigationService navigationServiceInstance, ILidarDistance lidar, IUltrasonic ultrasonic, IWheel wheel, IEncoders encoders, ExampleLogicService exampleLogic, StudentLogicService studentLogic) { _navigationService = navigationServiceInstance; Lidar = lidar; Ultrasonic = ultrasonic; Wheel = wheel; Encoders = encoders; ExampleLogic = exampleLogic; StudentLogic = studentLogic; ItemInvokedCommand = new DelegateCommand <WinUI.NavigationViewItemInvokedEventArgs>(OnItemInvoked); }
public ShowSubwheelActionEditorForm(ShowSubwheelAction action, IWheelElements elements) { InitializeComponent(); this.action = action; this.elements = elements; SubWheel = action.SubWheel; subWheelEditButton.Enabled = false; UpdateComboBox(); }
private string GetWheelSpecification(IWheel wheel) { if (wheel.IsWinter) { return "Winterreifen"; } if (wheel.IsMudSnow) { return "Ganzjahresreifen"; } return "Sommerreifen"; }
public Car( IWheel firstWheel, IWheel secondWheel, IWheel thirdWheel, IWheel fourthWheel, ITrailer trailer ) { FirstWheel = firstWheel; SecondWheel = secondWheel; ThirdWheel = thirdWheel; FourthWheel = fourthWheel; Trailer = trailer; }
private static IWheel GetWheelWithGivenWheelOperations(string descriptionString, IWheel wheel, IEnumerable<IWheelOperation> wheelOperations) { foreach (IWheelOperation operation in wheelOperations) { var pattern = AWheelOperations.GetPattern(descriptionString, operation.GetRegexPattern()); if (pattern.Equals(string.Empty)) { continue; } wheel = operation.SetValueOnWheel(wheel, pattern); descriptionString = AWheelOperations.CutFromString(descriptionString, pattern); } return wheel; }
public NameValueListTypeCollection GetItemSpecifics(IWheel wheel) { var result = new NameValueListTypeCollection(); result.Add(GetSingleItemSpecific("Reifenhersteller", wheel.Manufactorer)); result.Add(GetSingleItemSpecific("Hersteller-Artikelnummer", wheel.ArticleId)); result.Add(GetSingleItemSpecific("Reifenspezifikation", GetWheelSpecification(wheel))); result.Add(GetSingleItemSpecific("Reifenbreite", wheel.WheelWidth.ToString())); result.Add(GetSingleItemSpecific("Reifenquerschnitt", wheel.WheelHeight.ToString())); result.Add(GetSingleItemSpecific("Zollgröße", wheel.CrossSection.Replace('R', ' '))); result.Add(GetSingleItemSpecific("Tragfähigkeitsindex", wheel.WeightIndex.ToString())); result.Add(GetSingleItemSpecific("Geschwindigkeitsindex", wheel.SpeedIndex.ToString())); result.Add(GetSingleItemSpecific("Winterreifen (Ja/Nein)", wheel.IsWinter ? "Ja" : "Nein")); result.Add(GetSingleItemSpecific("Reifengröße", GetWheelSize(wheel))); return result; }
public SpeedControlViewModel(IWheel Wheel) { _wheel = Wheel; this.WhenAnyValue(x => x.Speed, speed => _wheel.Speed = speed) .Subscribe(s => _wheel.Speed = s); _wheel.Milage .ToProperty(this, w => w.Disstance, out _disstance); ReactiveCommand<object> resetDisstanceCommand = ReactiveCommand.Create(_wheel.Milage.Select(m => m > 0).ObserveOnDispatcher()); resetDisstanceCommand.Subscribe(_ => _wheel.Reset()); ResetDisstance = resetDisstanceCommand; }
public MsulEmulationParametersViewModel(IWheel Wheel, IPathRiderProvider PathRiderProvider) { _wheel = Wheel; TimeShift = TimeSpan.FromHours(15) - DateTime.Now.TimeOfDay; TrainNumber = 777; OutdoorTemperature = -18.4; EmergencyStop = false; LeftDoorLocked = true; RightDoorLocked = false; LeftDoorOpened = false; RightDoorOpened = false; LightOn = true; Carriages = new[] { new CarriageParametersViewModel(1, CarriageKind.TractionHead), new CarriageParametersViewModel(2, CarriageKind.HighVoltage), new CarriageParametersViewModel(3, CarriageKind.Normal), new CarriageParametersViewModel(4, CarriageKind.HighVoltage), new CarriageParametersViewModel(5, CarriageKind.TractionHead) }; Observable.Interval(TimeSpan.FromSeconds(1)) .Select(i => DateTime.Now + TimeShift) .ToProperty(this, x => x.Time, out _time); Observable.FromEvent(a => _wheel.SpeedChanged += (s, e) => a(), a => { }) .Select(_ => _wheel.Speed) .ToProperty(this, x => x.Speed, out _speed); PathRiderProvider.PathRider .CombineLatest(_wheel.Milage, (rider, milage) => rider.PointAt(milage)) .ToProperty(this, x => x.Position, out _position); }
public Car(IWheel wheel) { this.localWheel = wheel; }
private string GetDescriptionFromArticle(IWheel article, string template, int countOfArticles) { return string.Format(template, article.ImageLink, GetTitleFromArticle(article, countOfArticles), article.Manufactorer, article.WheelWidth, article.WheelHeight, article.CrossSection, article.WeightIndex, article.SpeedIndex, article.TyreLabelLink); }
public CarImproved() { GenericClassFactory<IWheel, Wheel> genericClassFactory = new GenericClassFactory<IWheel, Wheel>(); this.localWheel = genericClassFactory.CreateInstance(); }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.ManufactorerShortName = pattern; return wheel; }
private string GetWheelSize(IWheel wheel) { return string.Format(EbayArticleConstants.EbaySpecificationTemplate, wheel.WheelWidth, wheel.WheelHeight, wheel.CrossSection, wheel.WeightIndex, wheel.SpeedIndex); }
public void InitReplacer() { testValue = ""; testWheel = GetTestWheel(); this.replacer = new WheelPlaceholderReplacer(testWheel); }
public ICarBuilder AddWheel(IWheel wheel) { _wheels.Add(wheel); return this; }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.WeightIndex = AWheelOperations.GetIntegerFromString(pattern); return wheel; }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.IsWinter = true; return wheel; }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.WheelId = pattern; return wheel; }
public IPropertyExtractor GetPropertyExtractor(IWheel wheel) { return new PrestoshopWheelPropertyExtractor(wheel, marge, descriptionTemplate); }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.IsMudSnow = true; return wheel; }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.CrossSection = pattern; return wheel; }
public Trailer(IWheel firstWheel, IWheel secondWheel) { FirstWheel = firstWheel; SecondWheel = secondWheel; }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.SpeedIndex = pattern[0]; return wheel; }
public void SetupWheelPropertyExtractor() { testValue = ""; wheelToTest = GetWheelToTest(); extractor = new PrestoshopWheelPropertyExtractor(wheelToTest, 2, Placeholder.WheelPlaceholder.WheelCrossSectionPlaceholder); }
public void Setup() { this.wheel = Substitute.For<IWheel>(); GenericClassFactory<IWheel, Wheel>.Dispenser = (args) => this.wheel; }
public PrestoshopWheelPropertyExtractor(IWheel articleToUse, double marge, string descriptionTemplate) : base(articleToUse, marge, new WheelPlaceholderReplacer(articleToUse)) { this.wheel = articleToUse; this.descriptionTemplate = descriptionTemplate; }