Пример #1
0
        internal void CreateSkillEntity(ActionObject actionObject, Vector startPosition)
        {
            var entityName = ((ActionCode)actionObject.Code).ToString() + actionObject.GetNextID();

            var stringType = aiEntityNameSpace + (ActionCode)actionObject.Code + "AI";
            var actionType = Type.GetType(stringType);

            if (actionType == null)
            {
                log.ErrorFormat("Type {0} was not found.", stringType);
                return;
            }

            var skillEntity = new SkillEntity(actionObject.ActionSource, entityName, startPosition, TeamByEntity(actionObject.ActionSource), (ActionCode)actionObject.Code);

            World.Instance.AddEntity(skillEntity);
            Activator.CreateInstance(actionType, skillEntity);
        }