-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#267): Fixed type names in dicts
- Loading branch information
1 parent
23fe9f1
commit 87f07b5
Showing
13 changed files
with
355 additions
and
15 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
Buf/github.com/lxgr-linux/pokete/resources/base/achievements.pb.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,28 @@ | ||
# DO NOT EDIT! | ||
# This code was auto generated by the `protoc-gen-pokete-resources-python` plugin, | ||
# part of the pokete project, by <[email protected]> | ||
from typing import TypedDict | ||
|
||
|
||
class AchievementDict(TypedDict): | ||
title: str | ||
desc: str | ||
|
||
|
||
class Achievement: | ||
def __init__( | ||
self, | ||
title: str, | ||
desc: str | ||
): | ||
self.title: str = title | ||
self.desc: str = desc | ||
|
||
@classmethod | ||
def from_dict(cls, _d: AchievementDict | None) -> "Achievement" | None: | ||
if _d is None: | ||
return None | ||
return cls( | ||
title=_d["title"], | ||
desc=_d["desc"], | ||
) |
36 changes: 36 additions & 0 deletions
36
Buf/github.com/lxgr-linux/pokete/resources/base/items.pb.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,36 @@ | ||
# DO NOT EDIT! | ||
# This code was auto generated by the `protoc-gen-pokete-resources-python` plugin, | ||
# part of the pokete project, by <[email protected]> | ||
from typing import TypedDict | ||
|
||
|
||
class ItemDict(TypedDict): | ||
pretty_name: str | ||
desc: str | ||
price: int | ||
fn: str | None | ||
|
||
|
||
class Item: | ||
def __init__( | ||
self, | ||
pretty_name: str, | ||
desc: str, | ||
price: int, | ||
fn: str | None | ||
): | ||
self.pretty_name: str = pretty_name | ||
self.desc: str = desc | ||
self.price: int = price | ||
self.fn: str | None = fn | ||
|
||
@classmethod | ||
def from_dict(cls, _d: ItemDict | None) -> "Item" | None: | ||
if _d is None: | ||
return None | ||
return cls( | ||
pretty_name=_d["pretty_name"], | ||
desc=_d["desc"], | ||
price=_d["price"], | ||
fn=_d.get("fn", None), | ||
) |
32 changes: 32 additions & 0 deletions
32
Buf/github.com/lxgr-linux/pokete/resources/base/natures.pb.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,32 @@ | ||
# DO NOT EDIT! | ||
# This code was auto generated by the `protoc-gen-pokete-resources-python` plugin, | ||
# part of the pokete project, by <[email protected]> | ||
from typing import TypedDict | ||
|
||
|
||
class NatureDict(TypedDict): | ||
esc: str | ||
atc: float | ||
def: float | ||
|
||
|
||
class Nature: | ||
def __init__( | ||
self, | ||
esc: str, | ||
atc: float, | ||
def: float | ||
): | ||
self.esc: str = esc | ||
self.atc: float = atc | ||
self.def: float = def | ||
|
||
@classmethod | ||
def from_dict(cls, _d: NatureDict | None) -> "Nature" | None: | ||
if _d is None: | ||
return None | ||
return cls( | ||
esc=_d["esc"], | ||
atc=_d["atc"], | ||
def=_d["def"], | ||
) |
108 changes: 108 additions & 0 deletions
108
Buf/github.com/lxgr-linux/pokete/resources/base/poke.pb.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,108 @@ | ||
# DO NOT EDIT! | ||
# This code was auto generated by the `protoc-gen-pokete-resources-python` plugin, | ||
# part of the pokete project, by <[email protected]> | ||
from typing import TypedDict | ||
|
||
|
||
class BaseIcoDict(TypedDict): | ||
txt: str | ||
esc: str | None | ||
|
||
|
||
class BaseIco: | ||
def __init__( | ||
self, | ||
txt: str, | ||
esc: str | None | ||
): | ||
self.txt: str = txt | ||
self.esc: str | None = esc | ||
|
||
@classmethod | ||
def from_dict(cls, _d: BaseIcoDict | None) -> "BaseIco" | None: | ||
if _d is None: | ||
return None | ||
return cls( | ||
txt=_d["txt"], | ||
esc=_d.get("esc", None), | ||
) | ||
|
||
|
||
class PokeDict(TypedDict): | ||
name: str | ||
hp: int | ||
arc: 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 | ||
night_active: bool | None | ||
ico: list["BaseIcoDict"] | ||
|
||
|
||
class Poke: | ||
def __init__( | ||
self, | ||
name: str, | ||
hp: int, | ||
arc: 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, | ||
night_active: bool | None, | ||
ico: list["BaseIco"] | ||
): | ||
self.name: str = name | ||
self.hp: int = hp | ||
self.arc: int = arc | ||
self.defense: int = defense | ||
self.attacks: list[str] = attacks | ||
self.pool: list[str] = pool | ||
self.miss_chance: int = miss_chance | ||
self.desc: str = desc | ||
self.lose_xp: int = lose_xp | ||
self.rarity: int = rarity | ||
self.types: list[str] = types | ||
self.evolve_poke: str = evolve_poke | ||
self.evolve_lvl: int = evolve_lvl | ||
self.initiative: int = initiative | ||
self.night_active: bool | None = night_active | ||
self.ico: list["BaseIco"] = ico | ||
|
||
@classmethod | ||
def from_dict(cls, _d: PokeDict | None) -> "Poke" | None: | ||
if _d is None: | ||
return None | ||
return cls( | ||
name=_d["name"], | ||
hp=_d["hp"], | ||
arc=_d["arc"], | ||
defense=_d["defense"], | ||
attacks=_d["attacks"], | ||
pool=_d["pool"], | ||
miss_chance=_d["miss_chance"], | ||
desc=_d["desc"], | ||
lose_xp=_d["lose_xp"], | ||
rarity=_d["rarity"], | ||
types=_d["types"], | ||
evolve_poke=_d["evolve_poke"], | ||
evolve_lvl=_d["evolve_lvl"], | ||
initiative=_d["initiative"], | ||
night_active=_d.get("night_active", None), | ||
ico=[BaseIco.from_dict(i) for i in _d["ico"]], | ||
) |
32 changes: 32 additions & 0 deletions
32
Buf/github.com/lxgr-linux/pokete/resources/base/types.pb.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,32 @@ | ||
# DO NOT EDIT! | ||
# This code was auto generated by the `protoc-gen-pokete-resources-python` plugin, | ||
# part of the pokete project, by <[email protected]> | ||
from typing import TypedDict | ||
|
||
|
||
class TypeDict(TypedDict): | ||
effective: list[str] | ||
ineffective: list[str] | ||
color: list[str] | ||
|
||
|
||
class Type: | ||
def __init__( | ||
self, | ||
effective: list[str], | ||
ineffective: list[str], | ||
color: list[str] | ||
): | ||
self.effective: list[str] = effective | ||
self.ineffective: list[str] = ineffective | ||
self.color: list[str] = color | ||
|
||
@classmethod | ||
def from_dict(cls, _d: TypeDict | None) -> "Type" | None: | ||
if _d is None: | ||
return None | ||
return cls( | ||
effective=_d["effective"], | ||
ineffective=_d["ineffective"], | ||
color=_d["color"], | ||
) |
28 changes: 28 additions & 0 deletions
28
Buf/github.com/lxgr-linux/pokete/resources/base/weather.pb.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,28 @@ | ||
# DO NOT EDIT! | ||
# This code was auto generated by the `protoc-gen-pokete-resources-python` plugin, | ||
# part of the pokete project, by <[email protected]> | ||
from typing import TypedDict | ||
|
||
|
||
class WeatherDict(TypedDict): | ||
info: str | ||
effected: dict[str, float] | ||
|
||
|
||
class Weather: | ||
def __init__( | ||
self, | ||
info: str, | ||
effected: dict[str, float] | ||
): | ||
self.info: str = info | ||
self.effected: dict[str, float] = effected | ||
|
||
@classmethod | ||
def from_dict(cls, _d: WeatherDict | None) -> "Weather" | None: | ||
if _d is None: | ||
return None | ||
return cls( | ||
info=_d["info"], | ||
effected=_d["effected"], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
syntax = "proto3"; | ||
package pokete.resources.base; | ||
|
||
message Achievement { | ||
string Title = 1; | ||
string Desc = 2; | ||
} |
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 @@ | ||
syntax = "proto3"; | ||
package pokete.resources.base; | ||
|
||
message Item { | ||
string PrettyName = 1; | ||
string Desc = 2; | ||
int32 Price = 3; | ||
optional string Fn = 4; | ||
} |
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,8 @@ | ||
syntax = "proto3"; | ||
package pokete.resources.base; | ||
|
||
message Nature { | ||
string Esc = 1; | ||
float Atc = 2; | ||
float Def = 3; | ||
} |
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 @@ | ||
syntax = "proto3"; | ||
package pokete.resources.base; | ||
|
||
message BaseIco { | ||
string Txt = 1; | ||
optional string Esc = 2; | ||
} | ||
|
||
message Poke { | ||
string Name = 1; | ||
int32 Hp = 2; | ||
int32 Arc = 3; | ||
int32 Defense = 4; | ||
repeated string Attacks = 5; | ||
repeated string Pool = 6; | ||
int32 MissChance = 7; | ||
string Desc = 8; | ||
int32 LoseXp = 9; | ||
int32 Rarity = 10; | ||
repeated string Types = 11; | ||
string EvolvePoke = 12; | ||
int32 EvolveLvl = 13; | ||
int32 initiative = 14; | ||
optional bool NightActive = 15; | ||
repeated BaseIco ico = 16; | ||
} |
Oops, something went wrong.