Exemplo n.º 1
0
        static void Main(string[] args)
        {
            using IClockController ctrl = Logic.Factory.Create();
            List <IClockView> clockViews = new List <IClockView>();

            clockViews.Add(ctrl.CreateClockView("London"));
            clockViews.Add(ctrl.CreateClockView("Wien", 2));
            clockViews.Add(ctrl.CreateClockView("New York", -5));
            clockViews.Add(ctrl.CreateClockView("Isfahan", 4, 30));
            clockViews.Add(ctrl.CreateClockView("Vadodara", 5, 30));

            colors = (ConsoleColor[])ConsoleColor.GetValues(typeof(ConsoleColor));

            while (true)
            {
                Header();
                int i = 1;
                foreach (var clock in clockViews)
                {
                    Console.ForegroundColor = GetNextForegroundColor(i);
                    Console.Write($"{clock.TimeString} \n");
                    i++;
                }
                System.Threading.Thread.Sleep(1000);
                Console.Clear();
            }
        }
Exemplo n.º 2
0
 public BasicClock(XLoader loader, ClockSettings clockSettings, BasicClockView basicClockView, IClockController clockController, PhysicsRaycasterWithCache physicsRaycasterWithCache)
 {
     _loader                    = loader;
     _clockSettings             = clockSettings;
     _basicClockView            = basicClockView;
     _clockController           = clockController;
     _physicsRaycasterWithCache = physicsRaycasterWithCache;
 }
Exemplo n.º 3
0
        public ClockAdapter(Clock clock)
        {
            _clock = clock ?? throw new ArgumentNullException(nameof(clock));

            if (_clock.Parent != null)
            {
                _parent = new ClockAdapter(_clock.Parent);
            }
            if (clock.Controller != null)
            {
                _clockController = new ClockControllerAdapter(this, _clock.Controller);
            }

            _clock.Completed                     += (sender, e) => Completed?.Invoke(sender, e);
            _clock.RemoveRequested               += (sender, e) => RemoveRequested?.Invoke(sender, e);
            _clock.CurrentTimeInvalidated        += (sender, e) => CurrentTimeInvalidated?.Invoke(sender, e);
            _clock.CurrentStateInvalidated       += (sender, e) => CurrentStateInvalidated?.Invoke(sender, e);
            _clock.CurrentGlobalSpeedInvalidated += (sender, e) => CurrentGlobalSpeedInvalidated?.Invoke(sender, e);
        }