Пример #1
0
        public string GetState(string aActionName)
        {
            var action = FindAction(aActionName);

            AntLog.Assert(action == null, string.Format("Action \"{0}\" not registered!", aActionName), true);
            return(action.state);
        }
Пример #2
0
        public virtual void Add <T>(int aPriority = 0)
        {
            Type            type        = typeof(T);
            ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes);
            ISystem         system      = (ISystem)constructor.Invoke(null);

            AntLog.Assert(system == null, "Class \"" + AntLog.Bold(type.ToString()) + "\" not implemented ISystem interface!");
            Add(system, aPriority);
        }
Пример #3
0
        /// <summary>
        /// Устанавливает состояение по умолчанию как текущее.
        /// </summary>
        public void SetDefaultState()
        {
            if (currentState != null)
            {
                currentState.Stop();
            }

            AntLog.Assert(defaultState == null, "Default <b>State</b> is not defined!", true);
            currentState = defaultState;
            currentState.Reset();
            currentState.Start();
        }