コード例 #1
0
    def parser(self, config_value):
        """解析config到HeroConfig"""
        for row in config_value:
            convert_keystr2num(row.get('Skill_condition'))
            row["Consume"] = parse(row.get("Consume"))

            if row["type"] not in self.items:
                self.items[row["type"]] = {}
            self.items[row["type"]][row["Skill_level"]] = CommonItem(row)
            self.items[row["id"]] = CommonItem(row)
        return self.items
コード例 #2
0
 def parser(self, config_value):
     """解析config到HeroConfig"""
     for row in config_value:
         row["resource1"] = parse(row.get("resource1"))
         row["resource2"] = parse(row.get("resource2"))
         self.items[row.get('id')] = CommonItem(row)
     return self.items
コード例 #3
0
    def parser(self, config_value):
        for row in config_value:
            conditions = set()
            for i in range(1, 8):
                condition = row.get(u'condition%s' % i, None)
                if condition:
                    conditions.add(condition)
            row['conditions'] = conditions

            skill_ids = {}
            for i in range(1, 8):
                sid = row.get(r'triggle%s' % i, None)
                if sid:
                    skill_ids[i] = sid
            row['skill_ids'] = skill_ids

            expends = {}
            for i in range(1, 8):
                expend = row.get(r'expend%s' % i, None)
                if expend:
                    expends[i] = expend
            row['expends'] = expends

            self._warriors[row.get('id')] = CommonItem(row)

        return self._warriors
コード例 #4
0
    def parser(self, config_value):
        """解析config到HeroConfig"""
        for row in config_value:
            obj = CommonItem(row)
            self._items[obj.trigger_1] = obj

        return self._items
コード例 #5
0
 def parser(self, config_value):
     """解析config到HeroConfig"""
     for row in config_value:
         convert_keystr2num(row.get('triggerProbability'))
         row["singleConsumption"] = parse(row.get("singleConsumption"))
         row["silver"] = parse(row.get("silver"))
         self.items[row.get('level')] = CommonItem(row)
     return self.items
コード例 #6
0
    def parser(self, config_value):
        """解析config到HeroConfig"""
        for row in config_value:
            obj = CommonItem(row)
            self._chips[obj.id] = obj
            self._mapping[obj.combineResult] = obj

        return {'chips': self._chips, 'mapping': self._mapping}
コード例 #7
0
 def parser(self, config_value):
     for row in config_value:
         convert_keystr2num(row.get('robbedPercentage'))
         convert_keystr2num(row.get('peoplePercentage'))
         row["reward1"] = parse(row.get("reward1"))
         row["reward2"] = parse(row.get("reward2"))
         row["reward3"] = parse(row.get("reward3"))
         self.items[row.get('id')] = CommonItem(row)
     return self.items
コード例 #8
0
    def parser(self, config_value):
        """解析config到HeroConfig"""
        for row in config_value:
            row["sacrificeGain"] = parse(row.get("sacrificeGain"))
            obj = CommonItem(row)
            self._chips[obj.id] = obj
            if self._map.get(obj.combineResult):
                self._map.get(obj.combineResult).append(obj.id)
            else:
                self._map[obj.combineResult] = [obj.id]
            self._mapping[obj.combineResult] = obj

        return {'chips': self._chips, 'mapping': self._mapping, 'map': self._map}
コード例 #9
0
 def parser(self, config_value):
     """解析config到HeroConfig"""
     for row in config_value:
         convert_keystr2num(row.get('awake'))
         row["sacrificeGain"] = parse(row.get("sacrificeGain"))
         row["sellGain"] = parse(row.get("sellGain"))
         if row['quality'] == 2:
             row['color'] = 1
         elif row['quality'] == 3 or row['quality'] == 4:
             row['color'] = 2
         elif row['quality'] == 5 or row['quality'] == 6:
             row['color'] = 3
         self.heros[row.get('id')] = CommonItem(row)
     return self.heros
コード例 #10
0
ファイル: guild_config.py プロジェクト: Cuick/traversing
    def parser(self, config_value):
        """解析config到GuildConfig"""
        for row in config_value:

            convert_keystr2num(row.get("worShip"))
            convert_keystr2num(row.get("guild_worship"))
            convert_keystr2num(row.get("reward"))
            convert_keystr2num(row.get("cohesion"))
            convert_keystr2num(row.get("animalOpen"))
            row["support"] = parse(row.get("support"))
            row["collectSupportGift"] = parse(row.get("collectSupportGift"))
            item = CommonItem(row)
            if self._guild.get(row.get('type')):
                self._guild[row.get('type')][row.get('level')] = item
            else:
                self._guild[row.get('type')] = {row.get('level'): item}
            self._guild[item.id] = item
        return self._guild
コード例 #11
0
    def parser(self, config_value):
        """解析config到HeroConfig"""
        def convert_keystr2num(d):
            for k in d.keys():
                nk = None
                v = d[k]
                try:
                    nk = eval(k)
                except:
                    pass
                if nk is not None:
                    del d[k]
                    d[nk] = v
                if isinstance(v, dict):
                    convert_keystr2num(v)

        for row in config_value:
            convert_keystr2num(row.get('awake'))
            row["sacrificeGain"] = parse(row.get("sacrificeGain"))
            row["sellGain"] = parse(row.get("sellGain"))
            self.heros[row.get('id')] = CommonItem(row)
        return self.heros
コード例 #12
0
 def parser(self, config_value):
     """解析config到GuildConfig"""
     for row in config_value:
         self._guild[row.get('level')] = CommonItem(row)
     return self._guild
コード例 #13
0
 def parser(self, config_value):
     """解析config到HeroConfig"""
     for row in config_value:
         self.hero_exps[row.get('level')] = CommonItem(row)
     return self.hero_exps
コード例 #14
0
 def parser(self, config_value):
     """
     """
     for row in config_value:
         self.pushs[row.get('id')] = CommonItem(row)
     return self.pushs
コード例 #15
0
    def parser(self, config_value):
        for row in config_value:
            item = CommonItem(row)
            self._items[item.id] = item

        return self._items
コード例 #16
0
 def parser(self, config_value):
     """解析config到HeroConfig"""
     for row in config_value:
         self.items[row.get('id')] = CommonItem(row)
     return self.items
コード例 #17
0
 def parser(self, config_value):
     """解析config到HeroBreakupAttrConfig"""
     for row in config_value:
         self.heros[row.get('id')] = CommonItem(row)
     return self.heros