public object ConfigProcess(string[] row)

    {
        if (row.Length < 6)

        {
            return(null);
        }



        RowHelper rh = new RowHelper(row);

        DisassemblygirlTrophyConfig rec = new DisassemblygirlTrophyConfig();



        rec.id = CSVUtility.ToInt(rh.Read());        //id

        rec.name = rh.Read();                        //名字

        rec.type = rh.Read();                        //类型

        rec.conditionType = rh.Read();               //判断类型

        rec.threshold = CSVUtility.ToInt(rh.Read()); //数值

        rec.iconID = rh.Read();                      //图标ID

        return(rec);
    }
Exemplo n.º 2
0
        public static TrophyData FromConfig(DisassemblygirlTrophyConfig config)
        {
            TrophyData data = new TrophyData();

            data.id            = config.id;
            data.name          = config.name;
            data.threshold     = config.threshold;
            data.type          = (TrophyType)Enum.Parse(typeof(TrophyType), config.type);
            data.conditionType = (TrophyConditionType)Enum.Parse(typeof(TrophyConditionType), config.conditionType);
            data.iconID        = config.iconID;
            return(data);
        }
    public void Load()

    {
        CSVReader reader = new CSVReader();

        reader.LoadText("Config/Disassemblygirl_Trophy.txt", 3);

        int rows = reader.GetRowCount();

        for (int r = 0; r < rows; ++r)

        {
            string[] row = reader.GetRow(r);

            DisassemblygirlTrophyConfig ac = ConfigProcess(row) as DisassemblygirlTrophyConfig;

            configs.Add(ac.id, ac);
        }
    }