Ejemplo n.º 1
0
        public Continent(ContinentTemplate template, FieldManager fieldManager)
        {
            Template      = template;
            _fieldManager = fieldManager;

            var now = DateTime.Now;

            NextBoarding = now
                           .AddMinutes(now.Minute % Template.Term == 0
                    ? 0
                    : Template.Term - now.Minute % Template.Term)
                           .AddMinutes(Template.Delay)
                           .AddSeconds(-now.Second);
        }
Ejemplo n.º 2
0
        public Continent(ITemplateManager templateManager, FieldManager fieldManager, ContinentTemplate template)
        {
            Template           = template;
            _templateManager   = templateManager;
            StartShipMoveField = fieldManager.Get(template.StartShipMoveFieldID);
            WaitField          = fieldManager.Get(template.WaitFieldID);
            MoveField          = fieldManager.Get(template.MoveFieldID);
            if (template.CabinFieldID.HasValue)
            {
                CabinField = fieldManager.Get(template.CabinFieldID.Value);
            }
            EndField         = fieldManager.Get(template.EndFieldID);
            EndShipMoveField = fieldManager.Get(template.EndShipMoveFieldID);

            var now = DateTime.Now;

            NextBoarding = now
                           .AddMinutes(now.Minute % Template.Term == 0
                    ? 0
                    : Template.Term - now.Minute % Template.Term)
                           .AddMinutes(Template.Delay)
                           .AddSeconds(-now.Second);
            ResetEvent();
        }