demoparser.entities package

Submodules

demoparser.entities.base module

class demoparser.entities.base.BaseEntity(parser, index, class_id, serial, props)[source]

Bases: object

get_prop(table, var)[source]
owner

Find entity which owns this entity.

For example, a weapon entity belongs to a player entity. Calling this method on a weapon entity would return a player.

Returns:Owning entity.
position

Get the position of this entity.

server_class

Server class to which this entity belongs.

team

Team to which entity belongs.

Returns:Team entity
team_num

Entity team number.

Returns:Team number of entity.
update_prop(table, key, value)[source]

Update entity property.

demoparser.entities.entity_list module

class demoparser.entities.entity_list.EntityList(parser)[source]

Bases: collections.abc.MutableSequence

get_by_handle(handle)[source]
get_by_user_id(user_id)[source]
get_one(table)[source]
insert(index, value)[source]
new_entity(index, class_id, serial)[source]

Create new entity.

Returns:Created entity.
players

Get all Players in the entity list.

teams

Get all Teams in the entity list.

demoparser.entities.game_rules module

class demoparser.entities.game_rules.GameRules(parser, index, class_id, serial, props)[source]

Bases: demoparser.entities.base.BaseEntity

demoparser.entities.player module

class demoparser.entities.player.Player(parser, index, class_id, serial, props)[source]

Bases: demoparser.entities.base.BaseEntity

armor

Get armor value.

cash

Get

health

Get current health.

kills

Number of kills for this player.

life_state

Get life state.

0
Alive.
1
Dying. Either the death animation is still playing or the player is falling and waiting to hit the ground.
2
Dead. Not moving.
Returns:Life state.
name

Get player’s name.

place

Get last place player occupied.

A place refers a named navigation mesh. A navigation mesh represents the walkable areas of a map.

Returns:Name of last nav mesh occupied.
position

Get current position.

Returns:Position vector.
serialize(props=None)[source]
steam_id

Get Steam ID.

view_angle

Get current view angle.

Returns:Tuple of pitch and yaw.
weapon

Get current weapon.

demoparser.entities.team module

class demoparser.entities.team.Team(parser, index, class_id, serial, props)[source]

Bases: demoparser.entities.base.BaseEntity

clan

Clan name.

name

Team name. Either ‘T’ or ‘CT’.

score

Final team score.

score_first_half

Score for first half of match.

score_second_half

Score for second half of match.

demoparser.entities.weapon module

class demoparser.entities.weapon.Weapon(parser, index, class_id, serial, props)[source]

Bases: demoparser.entities.base.BaseEntity

item_index
name
previous_owner

Module contents