pyboxbuilder.project.manifest.GameComponent

class pyboxbuilder.project.manifest.GameComponent(name: str, count: int, category: str = '', notes: str = '', location: str = '', kind: str = 'piece', size: tuple[float, float] | tuple[float, float, float] | None = None, diameter: float | None = None, thickness: float | None = None, svg: str | None = None, bulk: bool = False)[source]

Bases: object

One declared physical component type in the board game’s inventory.

Carries both the piece count and optional physical description (card/piece dimensions, thickness, and SVG silhouette path) so boxes can derive their wells directly from the game catalog and verify_inventory() can verify count conservation, SVG shape coverage, and physical fit.

stack_height(qty: int) → float | None[source]

Return stacked height in mm for qty pieces, or None if thickness is unknown.

bulk : bool = False

If True, pieces are stored loose in a tray/compartment rather than individual shaped wells.

category : str = ''

Optional grouping category (e.g. "Cards", "Tokens", "Boards").

count : int

Total number of physical pieces of this component included in the game.

diameter : float | None = None

Optional diameter in mm for circular tokens, discs, or coins.

property footprint : tuple[float, float] | None

Return (W, L) footprint in mm derived from size or diameter.

kind : str = 'piece'

Kind of component ("cards", "piece", "tile", "board", or "loose").

location : str = ''

Optional loose storage location (e.g. "Inside spacer_1") for items without their own box.

name : str

Component name (e.g. "Action Cards", "Coal Cubes", "Player Boards").

notes : str = ''

Optional note.

property piece_height : float | None

Return single-piece height/thickness in mm if declared.

size : tuple[float, float] | tuple[float, float, float] | None = None

Optional (W, L) or (W, L, H) physical dimensions in mm.

svg : str | None = None

Optional path to an SVG silhouette file representing this piece’s outline.

thickness : float | None = None

Optional per-card or per-piece thickness in mm.