import os
import json
from pickler import decompress_pickle


class EffectsReference():
    def __init__(self):
        self.data = decompress_pickle(f'{os.path.dirname(__file__)}/data/Effects.pbz2')

    def get_effect_by_id(self, idv):
        idv = int(idv)
        for item in self.data:
            if idv == item['id']:
                return item
        return None
effects_reference = EffectsReference()