mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
building progress
This commit is contained in:
parent
066cf9287f
commit
812f3cdd0e
2 changed files with 9 additions and 4 deletions
|
|
@ -204,6 +204,7 @@ export interface BuildingState {
|
|||
level: number,
|
||||
team: Team,
|
||||
buildingType: BuildingType,
|
||||
buildProgress: number,
|
||||
}
|
||||
|
||||
export interface ProjectileState {
|
||||
|
|
@ -329,7 +330,7 @@ export class ParsedDemo {
|
|||
}
|
||||
|
||||
const PLAYER_PACK_SIZE = 9;
|
||||
const BUILDING_PACK_SIZE = 7;
|
||||
const BUILDING_PACK_SIZE = 8;
|
||||
const PROJECTILE_PACK_SIZE = 6;
|
||||
const CART_PACK_SIZE = 4;
|
||||
|
||||
|
|
@ -384,6 +385,7 @@ function unpackBuilding(bytes: Uint8Array, base: number, world: WorldBoundaries)
|
|||
const team = (((team_type_health >> 13) & 1) === 0) ? Team.Blue : Team.Red;
|
||||
const level = (team_type_health >> 14);
|
||||
const buildingType = ((team_type_health >> 10) & 7) as BuildingType;
|
||||
const buildProgress = bytes[base + 7];
|
||||
|
||||
return {
|
||||
position: {x, y},
|
||||
|
|
@ -392,6 +394,7 @@ function unpackBuilding(bytes: Uint8Array, base: number, world: WorldBoundaries)
|
|||
team,
|
||||
buildingType,
|
||||
level,
|
||||
buildProgress,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue