From 837a9c63d576a77cae50f07817270d2988e99d7a Mon Sep 17 00:00:00 2001 From: Nikita Tikhonov Date: Sat, 18 Nov 2023 20:39:05 +0300 Subject: [PATCH] Rename , preparing for 2.2 release. --- gd/api/database/database.py | 14 +++++++------- gd/api/database/values.py | 22 +++++++++++----------- gd/client.py | 4 ++-- gd/enums.py | 8 ++++---- gd/http.py | 2 +- gd/session.py | 4 ++-- gd/users.py | 16 ++++++++-------- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/gd/api/database/database.py b/gd/api/database/database.py index a6c86cb0..004fedb2 100644 --- a/gd/api/database/database.py +++ b/gd/api/database/database.py @@ -220,7 +220,7 @@ class Database(Binary): wave_id: int = field(default=DEFAULT_ICON_ID) robot_id: int = field(default=DEFAULT_ICON_ID) spider_id: int = field(default=DEFAULT_ICON_ID) - # swing_copter_id: int = field(default=DEFAULT_ICON_ID) + # swing_id: int = field(default=DEFAULT_ICON_ID) color_1_id: int = field(default=DEFAULT_COLOR_1_ID) color_2_id: int = field(default=DEFAULT_COLOR_2_ID) trail_id: int = field(default=DEFAULT_ICON_ID) @@ -321,7 +321,7 @@ def load_parts(cls: Type[D], main: bytes, levels: bytes) -> D: wave_id = main_data.get(WAVE_ID, DEFAULT_ICON_ID) robot_id = main_data.get(ROBOT_ID, DEFAULT_ICON_ID) spider_id = main_data.get(SPIDER_ID, DEFAULT_ICON_ID) - # swing_copter_id = main_data.get(SWING_COPTER_ID, DEFAULT_ICON_ID) + # swing_id = main_data.get(SWING_ID, DEFAULT_ICON_ID) color_1_id = main_data.get(COLOR_1_ID, DEFAULT_COLOR_1_ID) color_2_id = main_data.get(COLOR_2_ID, DEFAULT_COLOR_2_ID) @@ -527,7 +527,7 @@ def create_folder(string: str, name: str) -> Folder: wave_id=wave_id, robot_id=robot_id, spider_id=spider_id, - # swing_copter_id=swing_copter_id, + # swing_id=swing_id, color_1_id=color_1_id, color_2_id=color_2_id, trail_id=trail_id, @@ -594,7 +594,7 @@ def dump_main(self) -> bytes: WAVE_ID: self.wave_id, ROBOT_ID: self.robot_id, SPIDER_ID: self.spider_id, - # SWING_COPTER_ID: self.swing_copter_id, + # SWING_ID: self.swing_id, COLOR_1_ID: self.color_1_id, COLOR_2_ID: self.color_2_id, TRAIL_ID: self.trail_id, @@ -816,7 +816,7 @@ def from_binary( wave_id = reader.read_u8() robot_id = reader.read_u8() spider_id = reader.read_u8() - # swing_copter_id = reader.read_u8() + # swing_id = reader.read_u8() color_1_id = reader.read_u8() color_2_id = reader.read_u8() trail_id = reader.read_u8() @@ -1011,7 +1011,7 @@ def custom_object_from_binary() -> List[Object]: wave_id=wave_id, robot_id=robot_id, spider_id=spider_id, - # swing_copter_id=swing_copter_id, + # swing_id=swing_id, color_1_id=color_1_id, color_2_id=color_2_id, trail_id=trail_id, @@ -1108,7 +1108,7 @@ def to_binary( writer.write_u8(self.wave_id) writer.write_u8(self.robot_id) writer.write_u8(self.spider_id) - # writer.write_u8(self.swing_copter_id) + # writer.write_u8(self.swing_id) writer.write_u8(self.color_1_id) writer.write_u8(self.color_2_id) writer.write_u8(self.trail_id) diff --git a/gd/api/database/values.py b/gd/api/database/values.py index e92f6d14..859728c7 100644 --- a/gd/api/database/values.py +++ b/gd/api/database/values.py @@ -21,7 +21,7 @@ WAVES = "dart" ROBOTS = "robot" SPIDERS = "spider" -# SWING_COPTERS = "swing_copter" +# SWINGS = "swing" EXPLOSIONS = "death" STREAKS = "special" COLORS_1 = "c0" @@ -34,7 +34,7 @@ WAVES_PREFIX = prefix(WAVES) ROBOTS_PREFIX = prefix(ROBOTS) SPIDERS_PREFIX = prefix(SPIDERS) -# SWING_COPTERS_PREFIX = prefix(SWING_COPTERS) +# SWINGS_PREFIX = prefix(SWINGS) EXPLOSIONS_PREFIX = prefix(EXPLOSIONS) STREAKS_PREFIX = prefix(STREAKS) COLORS_1_PREFIX = prefix(COLORS_1) @@ -55,7 +55,7 @@ class Values(Binary): waves: OrderedSet[int] = field(factory=ordered_set) robots: OrderedSet[int] = field(factory=ordered_set) spiders: OrderedSet[int] = field(factory=ordered_set) - # swing_copters: OrderedSet[int] = field(factory=ordered_set) + # swings: OrderedSet[int] = field(factory=ordered_set) explosions: OrderedSet[int] = field(factory=ordered_set) streaks: OrderedSet[int] = field(factory=ordered_set) colors_1: OrderedSet[int] = field(factory=ordered_set) @@ -110,11 +110,11 @@ def to_binary( iter(spiders).for_each(writer.write_u8) - # swing_copters = self.swing_copters + # swings = self.swings - # writer.write_u8(len(swing_copters)) + # writer.write_u8(len(swings)) - # iter(swing_copters).for_each(writer.write_u8) + # iter(swings).for_each(writer.write_u8) explosions = self.explosions @@ -179,10 +179,10 @@ def from_binary( spiders = iter.repeat_exactly_with(reader.read_u8, spiders_length).ordered_set() - # swing_copters_length = reader.read_u8() + # swings_length = reader.read_u8() - # swing_copters = ( - # iter.repeat_exactly_with(reader.read_u8, swing_copters_length).ordered_set() + # swings = ( + # iter.repeat_exactly_with(reader.read_u8, swings_length).ordered_set() # ) explosions_length = reader.read_u8() @@ -210,7 +210,7 @@ def from_binary( waves=waves, robots=robots, spiders=spiders, - # swing_copters=swing_copters, + # swings=swings, explosions=explosions, streaks=streaks, colors_1=colors_1, @@ -227,7 +227,7 @@ def prefix_to_ordered_set(self) -> StringDict[OrderedSet[int]]: WAVES_PREFIX: self.waves, ROBOTS_PREFIX: self.robots, SPIDERS_PREFIX: self.spiders, - # SWING_COPTERS_PREFIX: self.swing_copters, + # SWINGS_PREFIX: self.swings, EXPLOSIONS_PREFIX: self.explosions, STREAKS_PREFIX: self.streaks, COLORS_1_PREFIX: self.colors_1, diff --git a/gd/client.py b/gd/client.py index 5fb37198..4b65681a 100644 --- a/gd/client.py +++ b/gd/client.py @@ -378,7 +378,7 @@ async def update_profile( wave_id: Optional[int] = None, robot_id: Optional[int] = None, spider_id: Optional[int] = None, - # swing_copter_id: Optional[int] = None, + # swing_id: Optional[int] = None, explosion_id: Optional[int] = None, special: int = DEFAULT_SPECIAL, *, @@ -417,7 +417,7 @@ async def update_profile( wave_id=switch_none(wave_id, cosmetics.wave_id), robot_id=switch_none(robot_id, cosmetics.robot_id), spider_id=switch_none(spider_id, cosmetics.spider_id), - # swing_copter_id=switch_none(swing_copter_id, cosmetics.swing_copter_id), + # swing_id=switch_none(swing_id, cosmetics.swing_id), explosion_id=switch_none(explosion_id, cosmetics.explosion_id), special=special, account_id=self.account_id, diff --git a/gd/enums.py b/gd/enums.py index 29017ce7..f5aed2c4 100644 --- a/gd/enums.py +++ b/gd/enums.py @@ -162,7 +162,7 @@ class IconType(Enum): WAVE = 4 ROBOT = 5 SPIDER = 6 - # SWING_COPTER = 7 + # SWING = 7 DEFAULT = CUBE @@ -190,8 +190,8 @@ def is_robot(self) -> bool: def is_spider(self) -> bool: return self is type(self).SPIDER - # def is_swing_copter(self) -> bool: - # return self is type(self).SWING_COPTER + # def is_swing(self) -> bool: + # return self is type(self).SWING class MessageState(Enum): @@ -1114,7 +1114,7 @@ class GameMode(Enum): WAVE = 4 ROBOT = 5 SPIDER = 6 - # SWING_COPTER = 7 + # SWING = 7 DEFAULT = CUBE diff --git a/gd/http.py b/gd/http.py index 1ba697e7..40a3647d 100644 --- a/gd/http.py +++ b/gd/http.py @@ -1085,7 +1085,7 @@ async def update_profile( wave_id: int, robot_id: int, spider_id: int, - # swing_copter_id: int, + # swing_id: int, explosion_id: int, special: int = DEFAULT_SPECIAL, *, diff --git a/gd/session.py b/gd/session.py index 81f36d12..bed4759e 100644 --- a/gd/session.py +++ b/gd/session.py @@ -165,7 +165,7 @@ async def update_profile( wave_id: int, robot_id: int, spider_id: int, - # swing_copter_id: int, + # swing_id: int, explosion_id: int, special: int = DEFAULT_SPECIAL, *, @@ -191,7 +191,7 @@ async def update_profile( wave_id=wave_id, robot_id=robot_id, spider_id=spider_id, - # swing_copter_id=swing_copter_id, + # swing_id=swing_id, explosion_id=explosion_id, special=special, account_id=account_id, diff --git a/gd/users.py b/gd/users.py index fa832ea4..0a9342ad 100644 --- a/gd/users.py +++ b/gd/users.py @@ -192,7 +192,7 @@ class UserCosmeticsData(Data): wave_id: int robot_id: int spider_id: int - swing_copter_id: int + swing_id: int explosion_id: int glow: bool @@ -210,7 +210,7 @@ class UserCosmetics(Binary): wave_id: int = DEFAULT_ICON_ID robot_id: int = DEFAULT_ICON_ID spider_id: int = DEFAULT_ICON_ID - # swing_copter_id: int = DEFAULT_ICON_ID + # swing_id: int = DEFAULT_ICON_ID explosion_id: int = DEFAULT_ICON_ID glow: bool = DEFAULT_GLOW @@ -251,7 +251,7 @@ def from_binary( wave_id = reader.read_u8() robot_id = reader.read_u8() spider_id = reader.read_u8() - # swing_copter_id = reader.read_u8() + # swing_id = reader.read_u8() explosion_id = reader.read_u8() @@ -267,7 +267,7 @@ def from_binary( wave_id=wave_id, robot_id=robot_id, spider_id=spider_id, - # swing_copter_id=swing_copter_id, + # swing_id=swing_id, explosion_id=explosion_id, glow=glow, ) @@ -297,7 +297,7 @@ def to_binary( writer.write_u8(self.wave_id) writer.write_u8(self.robot_id) writer.write_u8(self.spider_id) - # writer.write_u8(self.swing_copter_id) + # writer.write_u8(self.swing_id) writer.write_u8(self.explosion_id) @@ -322,7 +322,7 @@ def icon_id_by_type(self) -> Dict[IconType, int]: IconType.WAVE: self.wave_id, IconType.ROBOT: self.robot_id, IconType.SPIDER: self.spider_id, - # IconType.SWING_COPTER: self.swing_copter_id, + # IconType.SWING: self.swing_id, } def get_icon(self, type: Optional[IconType] = None) -> Icon: @@ -900,7 +900,7 @@ def from_profile_model(cls: Type[U], model: ProfileModel) -> U: wave_id=model.wave_id, robot_id=model.robot_id, spider_id=model.spider_id, - # swing_copter_id=model.swing_copter_id, + # swing_id=model.swing_id, explosion_id=model.explosion_id, glow=model.glow, ), @@ -949,7 +949,7 @@ def from_search_user_and_profile_models( wave_id=profile_model.wave_id, robot_id=profile_model.robot_id, spider_id=profile_model.spider_id, - # swing_copter_id=profile_model.swing_copter_id, + # swing_id=profile_model.swing_id, explosion_id=profile_model.explosion_id, glow=profile_model.glow, ),