Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/genieutils/civ.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class Civ(GenieClass):
player_type: int
name: str
Expand Down
2 changes: 1 addition & 1 deletion src/genieutils/datfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class DatFile(GenieClass):
version: str
float_ptr_terrain_tables: list[int]
Expand Down
4 changes: 2 additions & 2 deletions src/genieutils/effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class EffectCommand(GenieClass):
type: int
a: int
Expand Down Expand Up @@ -32,7 +32,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Effect(GenieClass):
name: str
effect_commands: list[EffectCommand]
Expand Down
6 changes: 3 additions & 3 deletions src/genieutils/graphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class GraphicDelta(GenieClass):
graphic_id: int
padding_1: int
Expand Down Expand Up @@ -38,7 +38,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class GraphicAngleSound(GenieClass):
frame_num: int
sound_id: int
Expand Down Expand Up @@ -78,7 +78,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Graphic(GenieClass):
name: str
file_name: str
Expand Down
2 changes: 1 addition & 1 deletion src/genieutils/playercolour.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class PlayerColour(GenieClass):
id: int
player_color_base: int
Expand Down
12 changes: 6 additions & 6 deletions src/genieutils/randommaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class MapUnit(GenieClass):
unit: int
host_terrain: int
Expand Down Expand Up @@ -56,7 +56,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class MapTerrain(GenieClass):
proportion: int
terrain: int
Expand Down Expand Up @@ -87,7 +87,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class MapLand(GenieClass):
land_id: int
terrain: int
Expand Down Expand Up @@ -145,7 +145,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class MapElevation(GenieClass):
proportion: int
terrain: int
Expand Down Expand Up @@ -176,7 +176,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class MapInfo(GenieClass):
map_id: int
border_south_west: int
Expand Down Expand Up @@ -277,7 +277,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class RandomMaps(GenieClass):
random_maps_ptr: int
map_info_1: list[MapInfo]
Expand Down
4 changes: 2 additions & 2 deletions src/genieutils/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class SoundItem(GenieClass):
filename: str
resource_id: int
Expand Down Expand Up @@ -32,7 +32,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Sound(GenieClass):
id: int
play_delay: int
Expand Down
2 changes: 1 addition & 1 deletion src/genieutils/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class Task(GenieClass):
task_type: int
id: int
Expand Down
4 changes: 2 additions & 2 deletions src/genieutils/tech.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class ResearchResourceCost(GenieClass):
type: int
amount: int
Expand All @@ -26,7 +26,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Tech(GenieClass):
required_techs: tuple[int, int, int, int, int, int]
resource_costs: tuple[ResearchResourceCost, ResearchResourceCost, ResearchResourceCost]
Expand Down
12 changes: 6 additions & 6 deletions src/genieutils/techtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class Common(GenieClass):
slots_used: int
unit_research: tuple[int, int, int, int, int, int, int, int, int, int]
Expand All @@ -26,7 +26,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class TechTreeAge(GenieClass):
id: int
status: int
Expand Down Expand Up @@ -89,7 +89,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class BuildingConnection(GenieClass):
id: int
status: int
Expand Down Expand Up @@ -152,7 +152,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class UnitConnection(GenieClass):
id: int
status: int
Expand Down Expand Up @@ -207,7 +207,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class ResearchConnection(GenieClass):
id: int
status: int
Expand Down Expand Up @@ -266,7 +266,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class TechTree(GenieClass):
total_unit_tech_groups: int
tech_tree_ages: list[TechTreeAge]
Expand Down
8 changes: 4 additions & 4 deletions src/genieutils/terrainblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class FrameData(GenieClass):
frame_count: int
angle_count: int
Expand All @@ -26,7 +26,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Terrain(GenieClass):
enabled: int
random: int
Expand Down Expand Up @@ -153,7 +153,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class TileSize(GenieClass):
width: int
height: int
Expand All @@ -175,7 +175,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class TerrainBlock(GenieClass):
virtual_function_ptr: int
map_pointer: int
Expand Down
4 changes: 2 additions & 2 deletions src/genieutils/terrainrestriction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class TerrainPassGraphic(GenieClass):
exit_tile_sprite_id: int
enter_tile_sprite_id: int
Expand All @@ -29,7 +29,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class TerrainRestriction(GenieClass):
passable_buildable_dmg_multiplier: list[float]
terrain_pass_graphics: list[TerrainPassGraphic]
Expand Down
24 changes: 12 additions & 12 deletions src/genieutils/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from genieutils.versions import Version


@dataclass
@dataclass(slots=True)
class ResourceStorage(GenieClass):
type: int
amount: float
Expand All @@ -27,7 +27,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class DamageGraphic(GenieClass):
graphic_id: int
damage_percent: int
Expand All @@ -49,7 +49,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class DeadFish(GenieClass):
walking_graphic: int
running_graphic: int
Expand Down Expand Up @@ -104,7 +104,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Bird(GenieClass):
default_task_id: int
search_radius: float
Expand Down Expand Up @@ -167,7 +167,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class AttackOrArmor(GenieClass):
class_: int
amount: int
Expand All @@ -186,7 +186,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Type50(GenieClass):
base_armor: int
attacks: list[AttackOrArmor]
Expand Down Expand Up @@ -291,7 +291,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Projectile(GenieClass):
projectile_type: int
smart_mode: int
Expand Down Expand Up @@ -322,7 +322,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class ResourceCost(GenieClass):
type: int
amount: int
Expand All @@ -344,7 +344,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Creatable(GenieClass):
resource_costs: tuple[ResourceCost, ResourceCost, ResourceCost]
train_time: int
Expand Down Expand Up @@ -435,7 +435,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class BuildingAnnex(GenieClass):
unit_id: int
misplacement_x: float
Expand All @@ -457,7 +457,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Building(GenieClass):
construction_graphic_id: int
snow_graphic_id: int
Expand Down Expand Up @@ -548,7 +548,7 @@ def to_bytes(self, version: Version) -> bytes:
])


@dataclass
@dataclass(slots=True)
class Unit(GenieClass):
type: int
id: int
Expand Down
Loading