Beispiel #1
0
 protected satellite(satellite tempSatellite)
 {
     Altitude = tempSatellite.Altitude;
     Location = tempSatellite.Location;
     Fuel     = tempSatellite.Fuel;
     Id       = instance;
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public override string VisitSatellite(satellite concreteElementA)
        {
            string state = "bad";

            if (concreteElementA.GetFuel() > 0)
            {
                state = "good";
            }
            return("the state of fuel is :" + state);
        }
Beispiel #4
0
        // utilities
        public satellite FindId(int id)
        {
            satellite current = satellites.First();

            foreach (var item in satellites)
            {
                if (item.GetId() == id)
                {
                    return(item);
                }
            }
            return(null);
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
 public abstract string VisitSatellite(satellite concreteElementA);
Beispiel #7
0
 public void ContextUpdate(int weather, satellite sat)
 {
     _strategy.Update(weather, sat);
 }
Beispiel #8
0
 public override void Update(int weather, satellite sat)
 {
     subject.message.AddLast("satellite " + sat.GetId() + ":cyber cyber cyber");
 }
Beispiel #9
0
 public override void Update(int weather, satellite sat)
 {
     subject.message.AddLast("satellite " + sat.GetId() + "update" + "weather is : " + weather.ToString());
 }
Beispiel #10
0
 public abstract void Update(int weather, satellite sat);
Beispiel #11
0
 public void Unsubscribe(satellite observer)
 {
     observers.Remove(observer);
 }
Beispiel #12
0
 public void Subscribe(satellite observer)
 {
     observers.AddLast(observer);
 }