Пример #1
0
    //public static Skill GetSkillByName(string skill){
    //    return Skill.ReturnSkillByString((Skill.SkillClasses)Enum.Parse(typeof(Skill.SkillClasses), skill));
    //}

    /*
     * Utility Functions
     */

    public static Unit BuildInitial(FactionType fType, UnitType uType, int team, ClassNode classObj = null, int val = 1)
    {
        List <string> avoidNames = team == BoardProxy.PLAYER_TEAM ?
                                   new List <string>(BaseSaver.GetPlayer().characters.Select(chr => chr.characterMoniker)) :
                                   new List <string>();
        string uName = UnitNameGenerator.GenerateRandomName(avoidNames, fType);
        Unit   bUnit = new Unit(uName, uName, 0, team, 3, 1, 3, 2, 1, 1, new string[] { }, "", uType, fType);

        if (classObj == null)
        {
            classObj = ClassNode.ComputeClassObject(fType, uType);
        }
        else
        {
            bUnit = new Unit(uName, uName, 0, team, val, val, 3, 2, 1, 1, new string[] { }, "", uType, fType);
        }
        bUnit = classObj.UpgradeCharacter(bUnit);
        bUnit.SetCurrentClass(classObj.GetType().Name);
        return(bUnit);
    }