File WfPlayer.h
FileList > game > include > WfPlayer.h
Go to the source code of this file
#include <cglm/cglm.h>#include "WfEnums.h"#include "InputContext.h"
Classes
| Type | Name |
|---|---|
| struct | WfAnimationSet A set of anumations drawn behind and in front of the base sprite. |
| struct | WfAnimationSetLayer A set of animations for everything the player can do. |
| struct | WfPlayerEntData |
Public Types
| Type | Name |
|---|---|
| enum | WfAnimationLayerNames |
| enum | WfBGAnimationLayerNames |
| enum | WfPlayerDirection |
| enum | WfPlayerState |
Public Functions
| Type | Name |
|---|---|
| void | WfDeSerializePlayerEntity (struct BinarySerializer * bs, struct Entity2D * pOutEnt, struct GameLayer2DData * pData) |
| struct Component2D * | WfGetPlayerAnimationLayerComponent (struct Entity2D * pPlayer, enum WfAnimationLayerNames layer) |
| struct WfAnimationSet * | WfGetPlayerAnimationSet (struct Entity2D * pInPlayerEnt) |
| struct WfPlayerEntData * | WfGetPlayerEntData (struct Entity2D * pInEnt) |
| struct WfInventory * | WfGetPlayerInventory (struct WfPlayerEntData * pEntData) |
| void | WfInitPlayer () |
| void | WfMakeIntoPlayerEntity (struct Entity2D * pInEnt, struct GameFrameworkLayer * pLayer, vec2 spawnAtGroundPos) |
| void | WfPlayerGetGroundContactPoint (struct Entity2D * pEnt, vec2 outPos) |
| void | WfSerializePlayerEntity (struct BinarySerializer * bs, struct Entity2D * pInEnt, struct GameLayer2DData * pData) |
| void | WfSetPlayerAnimationSet (struct Entity2D * pInPlayerEnt, const struct WfAnimationSet * pInSet) |
| void | WfSetPlayerOverlayAnimations (enum WfDirection dir, struct GameFrameworkLayer * pLayer, struct WfPlayerEntData * pPlayerEntData, struct Entity2D * pEnt) |
Macros
| Type | Name |
|---|---|
| define | NUM_ANIMATIONS NumDirections |
| define | PLAYER_BG_SPRITE_COMP_START 1 |
| define | PLAYER_COLLIDER_COMP_INDEX 0 |
| define | PLAYER_NUM_BG_SPRITES 2 |
| define | PLAYER_SPRITE_COMP_INDEX 3 |
Public Types Documentation
enum WfAnimationLayerNames
enum WfAnimationLayerNames {
WfHairAnimationLayer,
WfTorsoAnimationLayer,
WfLegAnimationLayer,
WfToolAnimationLayer,
WfNumAnimationLayers
};
enum WfBGAnimationLayerNames
enum WfBGAnimationLayerNames {
WfBG1,
WfBG2,
WfNumBackgroundAnimationLayers
};
enum WfPlayerDirection
enum WfPlayerDirection {
WfPD_Up = 1,
WfPD_Down = (1 << 1),
WfPD_Left = (1 << 2),
WfPD_Right = (1 << 3)
};
enum WfPlayerState
enum WfPlayerState {
WfWalking,
WfAttacking,
WfNumPlayerStates
};
Public Functions Documentation
function WfDeSerializePlayerEntity
void WfDeSerializePlayerEntity (
struct BinarySerializer * bs,
struct Entity2D * pOutEnt,
struct GameLayer2DData * pData
)
function WfGetPlayerAnimationLayerComponent
struct Component2D * WfGetPlayerAnimationLayerComponent (
struct Entity2D * pPlayer,
enum WfAnimationLayerNames layer
)
function WfGetPlayerAnimationSet
struct WfAnimationSet * WfGetPlayerAnimationSet (
struct Entity2D * pInPlayerEnt
)
function WfGetPlayerEntData
struct WfPlayerEntData * WfGetPlayerEntData (
struct Entity2D * pInEnt
)
function WfGetPlayerInventory
struct WfInventory * WfGetPlayerInventory (
struct WfPlayerEntData * pEntData
)
function WfInitPlayer
void WfInitPlayer ()
function WfMakeIntoPlayerEntity
void WfMakeIntoPlayerEntity (
struct Entity2D * pInEnt,
struct GameFrameworkLayer * pLayer,
vec2 spawnAtGroundPos
)
function WfPlayerGetGroundContactPoint
void WfPlayerGetGroundContactPoint (
struct Entity2D * pEnt,
vec2 outPos
)
function WfSerializePlayerEntity
void WfSerializePlayerEntity (
struct BinarySerializer * bs,
struct Entity2D * pInEnt,
struct GameLayer2DData * pData
)
function WfSetPlayerAnimationSet
void WfSetPlayerAnimationSet (
struct Entity2D * pInPlayerEnt,
const struct WfAnimationSet * pInSet
)
function WfSetPlayerOverlayAnimations
void WfSetPlayerOverlayAnimations (
enum WfDirection dir,
struct GameFrameworkLayer * pLayer,
struct WfPlayerEntData * pPlayerEntData,
struct Entity2D * pEnt
)
Macro Definition Documentation
define NUM_ANIMATIONS
#define NUM_ANIMATIONS `NumDirections`
define PLAYER_BG_SPRITE_COMP_START
#define PLAYER_BG_SPRITE_COMP_START `1`
define PLAYER_COLLIDER_COMP_INDEX
#define PLAYER_COLLIDER_COMP_INDEX `0`
define PLAYER_NUM_BG_SPRITES
#define PLAYER_NUM_BG_SPRITES `2`
define PLAYER_SPRITE_COMP_INDEX
#define PLAYER_SPRITE_COMP_INDEX `3`
The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/game/include/WfPlayer.h