コード例 #1
0
ファイル: Program.cs プロジェクト: gajdukov-anton/OOD
        static void Main(string [] args)
        {
            WeatherData.WeatherData wd           = new WeatherData.WeatherData();
            StatsDisplay            statsDisplay = new StatsDisplay();
            Display display = new Display();

            wd.RegisterObserver(display, 5);
            wd.RegisterObserver(statsDisplay, 4);
            wd.SetMeasurements(3, 0.7, 760, 10, 90);
            wd.SetMeasurements(4, 0.8, 761, 8, 100);
        }
コード例 #2
0
        static void Main(string [] args)
        {
            WeatherData.WeatherData weatheDataOut = new WeatherData.WeatherData(Observer.LocationKind.Outside);
            WeatherData.WeatherData weatheDataIn  = new WeatherData.WeatherData(Observer.LocationKind.Inside);

            Display      display      = new Display(weatheDataIn, weatheDataOut, 1);
            StatsDisplay statsDisplay = new StatsDisplay(weatheDataIn, weatheDataOut, 2);

            weatheDataOut.SetMeasurements(3, 0.7, 760);
            weatheDataIn.SetMeasurements(10, 0.8, 761);
        }