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

Wraps a GGXXACPR_Entity struct pointer and provides conversions and interpretations of its data. More...

#include <ggxxacpr.hpp>

Public Member Functions

 Player (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 ()
ActionState actionState ()
auto actId ()
auto actTimer ()
auto health ()
auto playerIndex ()
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.
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.
void setActionState (ActionState state)
void setHealth (uint16_t value)
void setGuardState (GuardState state)
void setAttackState (AttackState state)
void setCommandState (CommandState state)
void setScale (Scale scale)
void setPosition (WorldCoordinate pos)
void setTension (uint16_t value)
void setGuardBar (int16_t value)
void setInvulnCounter (uint8_t value)
void setFRCTime (uint8_t value)
void setDizzyBuildup (int16_t value)
void setBurstMeter (int16_t value)

Detailed Description

Wraps a GGXXACPR_Entity struct pointer and provides conversions and 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 Player::getRaw() and use the GGXXACPR_Entity interface.

Constructor & Destructor Documentation

◆ Player()

ggxxacpr::Player::Player ( GGXXACPR_Entity * ref = nullptr)
inline
670 : raw(ref) {};

Member Function Documentation

◆ actId()

auto ggxxacpr::Player::actId ( )
inline
696{ return raw->actId; }

◆ actionState()

ActionState ggxxacpr::Player::actionState ( )
inline
693 {
694 return static_cast<ActionState>(raw->actionState);
695 }

◆ actTimer()

auto ggxxacpr::Player::actTimer ( )
inline
697{ return raw->actTimer; }

◆ attackState()

AttackState ggxxacpr::Player::attackState ( )
inline
703 {
704 return static_cast<AttackState>(raw->attackState);
705 }

◆ corePos()

ModelCoordinate ggxxacpr::Player::corePos ( )
inline

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

Combines GGXXACPR_Entity::coreX and GGXXACPR_Entity::coreY.

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

◆ damage()

uint8_t ggxxacpr::Player::damage ( )
inline

The damage value of the current action.

759{ return raw->actHeader.damage; }

◆ drawPriority()

int16_t ggxxacpr::Player::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.

755{ return raw->drawPriority; }

◆ getRaw()

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

Returns the underlying GGXXACPR_Entity struct pointer.

681{ return raw; }

◆ guardState()

GuardState ggxxacpr::Player::guardState ( )
inline
700 {
701 return static_cast<GuardState>(raw->guardState);
702 }

◆ health()

auto ggxxacpr::Player::health ( )
inline
698{ return raw->health; }

◆ hitstopTime()

uint8_t ggxxacpr::Player::hitstopTime ( )
inline

A counter for hitstop.

763{ return raw->hitstopTime; }

◆ id()

EntityId ggxxacpr::Player::id ( )
inline
684 {
685 return static_cast<EntityId>(raw->id);
686 }

◆ isFacingRight()

bool ggxxacpr::Player::isFacingRight ( )
inline
687 {
688 return static_cast<bool>(raw->bIsFacingRight);
689 }

◆ isLeftSide()

bool ggxxacpr::Player::isLeftSide ( )
inline
690 {
691 return static_cast<bool>(raw->bIsLeftSide);
692 }

◆ isValid()

bool ggxxacpr::Player::isValid ( )
inline

Checks if the underlying reference is valid.

+R's entity data structures are not initialized immediately, so this method should be used as a null check.

677{ return raw != nullptr; }

◆ playerIndex()

auto ggxxacpr::Player::playerIndex ( )
inline
699{ return raw->playerIndex; }

◆ position()

WorldCoordinate ggxxacpr::Player::position ( )
inline

The position of the player.

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

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

◆ scale()

Scale ggxxacpr::Player::scale ( )
inline

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

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

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

◆ setActionState()

void ggxxacpr::Player::setActionState ( ActionState state)
inline
806{raw->actionState = static_cast<uint32_t>(state); };

◆ setAttackState()

void ggxxacpr::Player::setAttackState ( AttackState state)
inline
809{raw->attackState = static_cast<uint32_t>(state); }

◆ setBurstMeter()

void ggxxacpr::Player::setBurstMeter ( int16_t value)
inline
828{ if (raw->playerEntityDataPtr) raw->playerEntityDataPtr->burstMeter = value; }

◆ setCommandState()

void ggxxacpr::Player::setCommandState ( CommandState state)
inline
810{raw->commandFlags = static_cast<uint32_t>(state); }

◆ setDizzyBuildup()

void ggxxacpr::Player::setDizzyBuildup ( int16_t value)
inline
827{ if (raw->playerEntityDataPtr) raw->playerEntityDataPtr->dizzyBuildup = value; }

◆ setFRCTime()

void ggxxacpr::Player::setFRCTime ( uint8_t value)
inline
826{ if (raw->playerEntityDataPtr) raw->playerEntityDataPtr->frcTime = value; }

◆ setGuardBar()

void ggxxacpr::Player::setGuardBar ( int16_t value)
inline
824{ if (raw->playerEntityDataPtr) raw->playerEntityDataPtr->guardBar = value; }

◆ setGuardState()

void ggxxacpr::Player::setGuardState ( GuardState state)
inline
808{raw->guardState = static_cast<uint16_t>(state); }

◆ setHealth()

void ggxxacpr::Player::setHealth ( uint16_t value)
inline
807{ raw->health = value; }

◆ setInvulnCounter()

void ggxxacpr::Player::setInvulnCounter ( uint8_t value)
inline
825{ if (raw->playerEntityDataPtr) raw->playerEntityDataPtr->invulnCounter = value; }

◆ setPosition()

void ggxxacpr::Player::setPosition ( WorldCoordinate pos)
inline
815 {
816 raw->xPos = pos.x;
817 raw->yPos = pos.y;
818 }

◆ setScale()

void ggxxacpr::Player::setScale ( Scale scale)
inline
811 {
812 raw->scale = scale._rawX;
813 raw->scaleY = scale._rawY;
814 }
Scale scale()
The scaling factor that should be applied to this player's colliders.
Definition ggxxacpr.hpp:718

◆ setTension()

void ggxxacpr::Player::setTension ( uint16_t value)
inline
823{ if (raw->playerEntityDataPtr) raw->playerEntityDataPtr->tension = value; }

◆ velocity()

WorldCoordinate ggxxacpr::Player::velocity ( )
inline

Player velocity given in world coordinates per frame.

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

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