public RpmObserver(Label label, BicycleSubject bicycleSubject) : base(label, bicycleSubject) { this.label = label; this.bicycleSubject = bicycleSubject; currentRpm = 0; currComputedValue = 0; bicycleSubject.AddObserver(this); }
public Form1() { InitializeComponent(); bicycleSubject = new BicycleSubject(); rpmObserver = new RpmObserver(lblRpm, bicycleSubject); caloriesObserver = new CaloriesPerHourObserver(lblCalories, bicycleSubject); kmsObserver = new KmPerHourObserver(lblKms, bicycleSubject); }