group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PendingShotIntent Struct Reference

PR-27: transient component placed on the shooter entity for the duration of one runWeapon invocation when the matching SHOT_INTENT packet was received from that client. More...

#include <AnimSnapshot.hpp>

Collaboration diagram for PendingShotIntent:
[legend]

Public Attributes

bool received = false
std::uint16_t targetClientId = 0xFFFFu
AnimSnapshot targetAnim {}

Detailed Description

PR-27: transient component placed on the shooter entity for the duration of one runWeapon invocation when the matching SHOT_INTENT packet was received from that client.

The server's tick path looks up the intent map by (shooterClientId, shotInputTick) BEFORE calling runWeapon; if a hit, it emplaces this component. WeaponSystem::handleFire reads it (via registry.try_get<PendingShotIntent>) to populate the ShotResolution's client-intent + anim-delta columns. The component is removed after runWeapon returns so it never stays around — only the current tick's shot can read it.

received == false means "no SHOT_INTENT for this tick's shot" (UDP loss, or client wasn't shooting); the component might still be present but the consumer should treat it as absent.

Member Data Documentation

◆ received

bool PendingShotIntent::received = false

◆ targetAnim

AnimSnapshot PendingShotIntent::targetAnim {}

◆ targetClientId

std::uint16_t PendingShotIntent::targetClientId = 0xFFFFu

The documentation for this struct was generated from the following file: