-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ebe7db
commit ce1019e
Showing
36 changed files
with
275 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .assets import Assets, BaseAssets | ||
from .maps import Map, Maps | ||
from .npcs import NPCs, NPC | ||
from .obmaps import Obmap, Obmaps | ||
from .stations import Station, Stations, Decorations, Decoration | ||
from .trainers import Trainer, Trainers | ||
from .base import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import TypedDict | ||
|
||
from .base import Items, Pokes, Natures, Weathers, Types, Achievements | ||
from .maps import Maps | ||
from .npcs import NPCs | ||
from .stations import Stations, Decorations | ||
from .trainers import Trainers | ||
from .obmaps import Obmaps | ||
|
||
|
||
class BaseAssets(TypedDict): | ||
items: Items | ||
pokes: Pokes | ||
natures: Natures | ||
weathers: Weathers | ||
types: Types | ||
achievements: Achievements | ||
|
||
|
||
class Assets(TypedDict): | ||
trainers: Trainers | ||
npcs: NPCs | ||
obmaps: Obmaps | ||
stations: Stations | ||
decorations: Decorations | ||
maps: Maps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .items import Items, Item | ||
from .poke import Pokes, Poke | ||
from .natures import Natures, Nature | ||
from .weather import Weather, Weathers | ||
from .attacks import Attack, Attacks | ||
from .types import Type, Types | ||
from .achievements import Achievement, Achievements |
9 changes: 9 additions & 0 deletions
9
pokete_classes/asset_service/asset_types/base/achievements.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class Achievement(TypedDict): | ||
title: str | ||
desc: str | ||
|
||
|
||
Achievements = dict[str, Achievement] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class Attack(TypedDict): | ||
name: str | ||
factor: float | ||
action: str | None | ||
world_action: str | ||
move: list[str] | ||
miss_chance: float | ||
min_lvl: int | ||
desc: str | ||
types: list[str] | ||
effect: str | None | ||
is_generic: bool | ||
ap: int | ||
|
||
|
||
Attacks = dict[str, Attack] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class Item(TypedDict): | ||
pretty_name: str | ||
desc: str | ||
price: int | ||
fn: str | None | ||
|
||
|
||
Items = dict[str, Item] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class Nature(TypedDict): | ||
esc: str | ||
atc: float | ||
_def: float | ||
|
||
|
||
Natures = dict[str, Nature] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class BaseIco(TypedDict): | ||
txt: str | ||
esc: str | None | ||
|
||
|
||
class Poke(TypedDict): | ||
name: str | ||
hp: int | ||
atc: int | ||
defense: int | ||
attacks: list[str] | ||
pool: list[str] | ||
miss_chance: int | ||
desc: str | ||
lose_xp: int | ||
rarity: int | ||
types: list[str] | ||
evolve_poke: str | ||
evolve_lvl: int | ||
initiative: int | ||
ico: list[BaseIco] | ||
|
||
|
||
Pokes = dict[str, Poke] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class Type(TypedDict): | ||
effective: list[str] | ||
ineffective: list[str] | ||
color: list[str] | ||
|
||
|
||
Types = dict[str, Type] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class Weather(TypedDict): | ||
info: str | ||
effected: dict[str, float] | ||
|
||
|
||
Weathers = dict[str, Weather] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import logging | ||
|
||
import pokete_data as p_data | ||
from .asset_types.assets import Assets, BaseAssets | ||
|
||
|
||
class AssetSerice: | ||
def __init__(self): | ||
self.__assets: Assets | None = None | ||
self.__base_assets: BaseAssets | None = None | ||
self.load_base_assets_from_p_data() | ||
|
||
def load_assets(self, assets: Assets): | ||
self.__assets = assets | ||
|
||
def __load_base_assets(self, base_assets: BaseAssets): | ||
self.__base_assets = base_assets | ||
|
||
def load_assets_from_p_data(self): | ||
if self.__assets is not None: | ||
logging.warning("[AssetService]: Assets already loaded") | ||
self.load_assets({ | ||
"trainers": p_data.trainers, | ||
"npcs": p_data.npcs, | ||
"obmaps": p_data.map_data, | ||
"stations": p_data.stations, | ||
"decorations": p_data.decorations, | ||
"maps": p_data.maps, | ||
}) | ||
|
||
def load_base_assets_from_p_data(self): | ||
self.__load_base_assets({ | ||
"items": p_data.items, | ||
"pokes": p_data.pokes, | ||
"natures": p_data.natures, | ||
"weathers": p_data.weathers, | ||
"types": p_data.types, | ||
"achievements": p_data.achievements | ||
}) | ||
|
||
def get_assets(self) -> Assets | None: | ||
return self.__assets | ||
|
||
def get_base_assets(self) -> BaseAssets: | ||
return self.__base_assets | ||
|
||
|
||
asset_service: AssetSerice = AssetSerice() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.