Courier Extractor¶
Courier state snapshots per tick.
gem.extractors.courier
¶
Courier state extractor for Dota 2 replays.
Tracks CDOTA_Unit_Courier entities and snapshots their position and state
at configurable tick intervals.
Reference: refs/parser/src/main/java/opendota/Parse.java (entity polling pattern)
CourierSnapshot
dataclass
¶
A single courier state sample at one tick.
Attributes:
| Name | Type | Description |
|---|---|---|
tick |
int
|
Game tick of this sample. |
team |
int
|
Team number (2=Radiant, 3=Dire). |
state |
int
|
|
flying |
bool
|
True if the courier is in flying form. |
x |
float | None
|
World x coordinate, or |
y |
float | None
|
World y coordinate, or |
Source code in src/gem/extractors/courier.py
CourierExtractor
¶
Polls courier entity state and accumulates snapshots.
Attach to a ReplayParser before calling parse():
Example
extractor = CourierExtractor() extractor.attach(parser) parser.parse() print(extractor.snapshots[:3])
Attributes:
| Name | Type | Description |
|---|---|---|
snapshots |
list[CourierSnapshot]
|
All collected |
Source code in src/gem/extractors/courier.py
__init__(sample_interval: int = 150) -> None
¶
Initialise the extractor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_interval
|
int
|
Minimum tick gap between successive snapshots. Default 150 ticks ≈ 5 seconds at 30 ticks/sec. |
150
|
Source code in src/gem/extractors/courier.py
attach(parser: ReplayParser) -> None
¶
Register callbacks with the parser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parser
|
ReplayParser
|
The |
required |