Пример #1
0
        public EmployeeClass(EmployeeClassDef definition)
        {
            Name   = definition.Name;
            Levels = definition.Levels;
            foreach (string s in definition.Actions)
            {
                var value = Task.TaskCategory.None;
                if (Enum.TryParse(s, true, out value))
                {
                    Actions |= value;
                }
            }

            Animations = AnimationLibrary.LoadCompositeAnimationSet(definition.Animations, Name);
            Attacks    = definition.Attacks;
        }
Пример #2
0
        public EmployeeClass(EmployeeClassDef definition)
        {
            Name = definition.Name;
            Levels = definition.Levels;
            Actions = new List<GameMaster.ToolMode>();
            foreach (string s in definition.Actions)
            {
                GameMaster.ToolMode value = GameMaster.ToolMode.SelectUnits;
                if (Enum.TryParse(s, true, out value))
                {
                    Actions.Add(value);
                }
            }

            CompositeAnimation.Descriptor descriptor = FileUtils.LoadJsonFromString<CompositeAnimation.Descriptor>(ContentPaths.GetFileAsString(definition.Animations));
            Animations = new List<Animation>();
            Animations.AddRange(descriptor.GenerateAnimations(Name));

            Attacks = definition.Attacks;
        }
Пример #3
0
        public EmployeeClass(EmployeeClassDef definition)
        {
            Name    = definition.Name;
            Levels  = definition.Levels;
            Actions = new List <GameMaster.ToolMode>();
            foreach (string s in definition.Actions)
            {
                GameMaster.ToolMode value = GameMaster.ToolMode.SelectUnits;
                if (Enum.TryParse(s, true, out value))
                {
                    Actions.Add(value);
                }
            }

            CompositeAnimation.Descriptor descriptor = FileUtils.LoadJsonFromString <CompositeAnimation.Descriptor>(ContentPaths.GetFileAsString(definition.Animations));
            Animations = new List <Animation>();
            Animations.AddRange(descriptor.GenerateAnimations(Name));

            Attacks = definition.Attacks;
        }