GearLoader 1.1.0
Mod loader for GGXXACPR
Loading...
Searching...
No Matches
ggxxacpr::Entity Class Reference

Wraps a GGXXACPR_Entity struct pointer and provides conversions and generic entity-oriented interpretations of its data. More...

#include <ggxxacpr.hpp>

Public Member Functions

 Entity (GGXXACPR_Entity *ref=nullptr)
bool isValid ()
 Checks if the underlying reference is valid.
GGXXACPR_EntitygetRaw ()
 Returns the underlying GGXXACPR_Entity struct pointer.
EntityId id ()
bool isFacingRight ()
bool isLeftSide ()
Entity prev ()
Entity next ()
ActionState actionState ()
auto actId ()
 The current action id.
auto actTimer ()
auto playerIndex ()
 the player index of the player that owns this entity.
GuardState guardState ()
AttackState attackState ()
ModelCoordinate corePos ()
 The position of the player's center point in model space.
Scale scale ()
 The scaling factor that should be applied to this player's colliders.
WorldCoordinate position ()
 The position of the player.
WorldCoordinate velocity ()
 Player velocity given in world coordinates per frame.
Angle angle ()
 Angle of the entity's sprite.
int16_t drawPriority ()
 Determines which sprites draw in which order.
uint8_t damage ()
 The damage value of the current action.
uint8_t hitstopTime ()
 A counter for hitstop.

Detailed Description

Wraps a GGXXACPR_Entity struct pointer and provides conversions and generic entity-oriented interpretations of its data.

This wrapper only exposes data that has a known use and only provides setters for data that has a known effect when changed. For full, direct data access, call Entity::getRaw() and use the GGXXACPR_Entity interface.

Constructor & Destructor Documentation

◆ Entity()

ggxxacpr::Entity::Entity ( GGXXACPR_Entity * ref = nullptr)
inline
846 : raw(ref) {}

Member Function Documentation

◆ actId()

auto ggxxacpr::Entity::actId ( )
inline

The current action id.

Many projectile entities share a common entity id and are only distinguished by animation id.

880{ return raw->actId; }

◆ actionState()

ActionState ggxxacpr::Entity::actionState ( )
inline
871 {
872 return static_cast<ActionState>(raw->actionState);
873 }

◆ actTimer()

auto ggxxacpr::Entity::actTimer ( )
inline
881{ return raw->actTimer; }

◆ angle()

Angle ggxxacpr::Entity::angle ( )
inline

Angle of the entity's sprite.

934{ return { raw->angle }; }

◆ attackState()

AttackState ggxxacpr::Entity::attackState ( )
inline
889 {
890 return static_cast<AttackState>(raw->attackState);
891 }

◆ corePos()

ModelCoordinate ggxxacpr::Entity::corePos ( )
inline

The position of the player's center point in model space.

Combines GGXXACPR_Entity::coreX and GGXXACPR_Entity::coreY.

897{ return {raw->coreX, raw->coreY}; }

◆ damage()

uint8_t ggxxacpr::Entity::damage ( )
inline

The damage value of the current action.

945{ return raw->actHeader.damage; }

◆ drawPriority()

int16_t ggxxacpr::Entity::drawPriority ( )
inline

Determines which sprites draw in which order.

Higher values draw first, lower values draw over higher values. Essentially a position on the z-axis / depth buffer.

941{ return raw->drawPriority; }

◆ getRaw()

GGXXACPR_Entity * ggxxacpr::Entity::getRaw ( )
inline

Returns the underlying GGXXACPR_Entity struct pointer.

856 {
857 return raw;
858 }

◆ guardState()

GuardState ggxxacpr::Entity::guardState ( )
inline
886 {
887 return static_cast<GuardState>(raw->guardState);
888 }

◆ hitstopTime()

uint8_t ggxxacpr::Entity::hitstopTime ( )
inline

A counter for hitstop.

949{ return raw->hitstopTime; }

◆ id()

EntityId ggxxacpr::Entity::id ( )
inline
860 {
861 return static_cast<EntityId>(raw->id);
862 }

◆ isFacingRight()

bool ggxxacpr::Entity::isFacingRight ( )
inline
863 {
864 return static_cast<bool>(raw->bIsFacingRight);
865 }

◆ isLeftSide()

bool ggxxacpr::Entity::isLeftSide ( )
inline
866 {
867 return static_cast<bool>(raw->bIsLeftSide);
868 }

◆ isValid()

bool ggxxacpr::Entity::isValid ( )
inline

Checks if the underlying reference is valid.

850 {
851 return raw != nullptr && raw->id != 0;
852 }

◆ next()

Entity ggxxacpr::Entity::next ( )
inline
870{ return raw->nextPtr; }

◆ playerIndex()

auto ggxxacpr::Entity::playerIndex ( )
inline

the player index of the player that owns this entity.

885{ return raw->playerIndex; }

◆ position()

WorldCoordinate ggxxacpr::Entity::position ( )
inline

The position of the player.

Sometimes called the "origin point" or "pivot".

926{ return {raw->xPos, raw->yPos}; }

◆ prev()

Entity ggxxacpr::Entity::prev ( )
inline
869{ return raw->prevPtr; }

◆ scale()

Scale ggxxacpr::Entity::scale ( )
inline

The scaling factor that should be applied to this player's colliders.

An interpretation of GGXXACPR_Entity::scale and GGXXACPR_Entity::scaleY.

904{ return { raw->scale, raw->scaleY }; }

◆ velocity()

WorldCoordinate ggxxacpr::Entity::velocity ( )
inline

Player velocity given in world coordinates per frame.

930{ return {raw->xVelocity, raw->yVelocity}; }

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