protected satellite(satellite tempSatellite) { Altitude = tempSatellite.Altitude; Location = tempSatellite.Location; Fuel = tempSatellite.Fuel; Id = instance; }
public void LaunchSatellite(string satType, int alt = 150, int location = 0, int fuel = 1000) { SatelliteFactory newSatellite = new SatelliteFactory(); satellite newSat = newSatellite.CreateSatellite(satType, alt, location, fuel); satellites.Add(newSat); }
public override string VisitSatellite(satellite concreteElementA) { string state = "bad"; if (concreteElementA.GetFuel() > 0) { state = "good"; } return("the state of fuel is :" + state); }
// utilities public satellite FindId(int id) { satellite current = satellites.First(); foreach (var item in satellites) { if (item.GetId() == id) { return(item); } } return(null); }
private void displayDataSat() { int location = satList.SelectedIndex; if (location < 1) { location = 1; } satellite sat = Program.station1.getList()[location]; altitude.Text = sat.GetAltitude().ToString(); fuel.Text = sat.GetFuel().ToString(); degree.Text = sat.getLocation().ToString(); }
public abstract string VisitSatellite(satellite concreteElementA);
public void ContextUpdate(int weather, satellite sat) { _strategy.Update(weather, sat); }
public override void Update(int weather, satellite sat) { subject.message.AddLast("satellite " + sat.GetId() + ":cyber cyber cyber"); }
public override void Update(int weather, satellite sat) { subject.message.AddLast("satellite " + sat.GetId() + "update" + "weather is : " + weather.ToString()); }
public abstract void Update(int weather, satellite sat);
public void Unsubscribe(satellite observer) { observers.Remove(observer); }
public void Subscribe(satellite observer) { observers.AddLast(observer); }