Beispiel #1
0
    def build_config(self, config):
        user_rm = 1000
        store = Store()
        store.register_all_table()

        store.set_rm(user_rm)

        bike_model = BikeModel.create_empty()
        bike_model = store.add_cache_bike(None, bike_model)
        config.setdefaults(
            'bike', {
                'rm': user_rm,
                'title': bike_model.title,
                'power': bike_model.power,
                'speed': bike_model.speed,
                'acceleration': bike_model.acceleration,
                'agility': bike_model.agility
            })

        map_model = MapModel.create_empty()
        map_model = store.add_cache_map(None, map_model)
        config.setdefaults(
            'map', {
                'title': map_model.title,
                'level': map_model.level,
                'map': map_model.map,
                'total_way': map_model.total_way
            })
Beispiel #2
0
    def setdefaults_config():
        Cache.register(CACHE_NAME, limit=1000)
        store = Store()
        store.register_all_table()

        store.set_rm(1000)
        store.add_cache_bike('Default')
        store.add_cache_map('Default')