How to use the cassiopeia.core.common.CassiopeiaGhost.property function in cassiopeia

To help you get started, we’ve selected a few cassiopeia examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github meraki-analytics / cassiopeia / cassiopeia / core / match.py View on Github external
    @CassiopeiaGhost.property(MatchData)
    @ghost_load_on
    @lazy
    def duration(self) -> datetime.timedelta:
        return self._data[MatchData].duration
github meraki-analytics / cassiopeia / cassiopeia / plugins / championgg / core.py View on Github external
    @CassiopeiaGhost.property(ChampionGGData)
    @ghost_load_on(KeyError)
    def deaths(self) -> SearchableDictionary:
        return SearchableDictionary({Role(role): value for role, value in self._data[ChampionGGData].deaths.items()})
github meraki-analytics / cassiopeia / cassiopeia / core / league.py View on Github external
    @CassiopeiaGhost.property(MasterLeagueListData)
    @ghost_load_on
    def id(self) -> str:
        return self._data[MasterLeagueListData].id
github meraki-analytics / cassiopeia / cassiopeia / core / staticdata / champion.py View on Github external
    @CassiopeiaGhost.property(ChampionReleaseData)
    @ghost_load_on
    @lazy
    def release_date(self) -> arrow.Arrow:
        return arrow.get(self._data[ChampionReleaseData].releaseDate)
github meraki-analytics / cassiopeia / cassiopeia / core / staticdata / item.py View on Github external
    @CassiopeiaGhost.property(ItemData)
    @ghost_load_on
    def keywords(self) -> List[str]:
        return SearchableList(self._data[ItemData].keywords)
github meraki-analytics / cassiopeia / cassiopeia / core / staticdata / item.py View on Github external
    @CassiopeiaGhost.property(ItemData)
    @ghost_load_on
    def name(self) -> str:
        return self._data[ItemData].name
github meraki-analytics / cassiopeia / cassiopeia / core / spectator.py View on Github external
    @CassiopeiaGhost.property(CurrentGameInfoData)
    @ghost_load_on
    @lazy
    def teams(self) -> List[Team]:
        return SearchableList([Team.from_data(team, match=self) for team in self._data[CurrentGameInfoData].teams])
github meraki-analytics / cassiopeia / cassiopeia / core / staticdata / summonerspell.py View on Github external
    @CassiopeiaGhost.property(SummonerSpellData)
    @ghost_load_on
    @lazy
    def image(self) -> Image:
        image = Image.from_data(self._data[SummonerSpellData].image)
        image(version=self.version)
        return image
github meraki-analytics / cassiopeia / cassiopeia / core / masterypage.py View on Github external
    @CassiopeiaGhost.property(MasteryPageData)
    @ghost_load_on(KeyError)
    def name(self) -> str:
        return self._data[MasteryPageData].name
github meraki-analytics / cassiopeia / cassiopeia / core / champion.py View on Github external
    @CassiopeiaGhost.property(ChampionRotationData)
    @ghost_load_on
    def free_champions(self) -> SearchableLazyList:
        gen = (Champion(region=self.region, id=id_) for id_ in self._data[ChampionRotationData].freeChampionIds)
        return SearchableLazyList(generator=gen)