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

            if (concreteElementA.GetFuel() > 0)
            {
                state = "good";
            }
            return("the state of fuel is :" + state);
        }
Пример #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);
        }
Пример #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();
        }
Пример #6
0
 public abstract string VisitSatellite(satellite concreteElementA);
Пример #7
0
 public void ContextUpdate(int weather, satellite sat)
 {
     _strategy.Update(weather, sat);
 }
Пример #8
0
 public override void Update(int weather, satellite sat)
 {
     subject.message.AddLast("satellite " + sat.GetId() + ":cyber cyber cyber");
 }
Пример #9
0
 public override void Update(int weather, satellite sat)
 {
     subject.message.AddLast("satellite " + sat.GetId() + "update" + "weather is : " + weather.ToString());
 }
Пример #10
0
 public abstract void Update(int weather, satellite sat);
Пример #11
0
 public void Unsubscribe(satellite observer)
 {
     observers.Remove(observer);
 }
Пример #12
0
 public void Subscribe(satellite observer)
 {
     observers.AddLast(observer);
 }