Troupe¶
- class Troupe(game: Game, team: str, allies: List[str])[source]¶
Bases:
object
Management of a group of units
- add_unit(unit: nqp.command.unit.Unit)[source]¶
Add a unit instance to the troupe. Used when buying an existing unit, e.g. from Inn.
- debug_init_units() List[int] [source]¶
Initialise all units for Troupe faction. Returns list of created ids.
- property entities: List[EntityID]¶
- generate_specific_units(unit_types: List[str]) List[int] [source]¶
Generate units for the Troupe, based on parameters given. Returns list of created ids.
unit_types is expressed as [unit.type, …]
- generate_units(number_of_units: int, tiers_allowed: List[int] = None, duplicates: bool = False) List[int] [source]¶
Generate units for the Troupe, based on parameters given.
- Returns
list of created ids.
- get_random_unit() nqp.command.unit.Unit [source]¶
Return a random unit from the Troupe.