Example #1
0
        static void Main(string[] args)
        {
            RenderWindow app = new RenderWindow(new VideoMode(800, 600), "Metonic Calendar");

            app.Closed += new EventHandler(OnClose);

            Nodes        nodes    = new Nodes();
            Sun          sun      = new Sun(nodes);
            Moon         moon     = new Moon();
            IMetonicYear year     = new MetonicYear();
            IMonth       month    = new Month(year, sun, moon);
            Day          day      = new Day(month, year);
            SunCount     sunCount = new SunCount(sun);

            Control controller = new Control(year, month, day, moon, sunCount, nodes, sun);

            controller.SetYearZero();

            Color windowColor = new Color(255, 255, 255);

            while (app.IsOpen)
            {
                app.DispatchEvents();
                app.Clear(windowColor);

                DrawCalendar(app, nodes, sun, moon, year, month, day, sunCount);

                app.Display();
                controller.AddDay();
                Thread.Sleep(1000);
            }
        }