File WfPlayer.c
FileList > entities > WfPlayer.c
Go to the source code of this file
#include "WfPlayer.h"#include "BinarySerializer.h"#include "Game2DLayer.h"#include "Entities.h"#include "ObjectPool.h"#include "DrawContext.h"#include "GameFramework.h"#include "AnimatedSprite.h"#include "Camera2D.h"#include "WfEntities.h"#include "WfUI.h"#include "WfEnums.h"#include "WfItem.h"#include "AssertLib.h"#include "WfPersistantGameData.h"#include "GameFrameworkEvent.h"#include "Scripting.h"#include <string.h>#include "Log.h"#include "Network.h"#include "Game2DLayerNetwork.h"#include "NetworkID.h"#include "Maths.h"
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) |
| float | WfGetPlayerSortPosition (struct Entity2D * pEnt) |
| void | WfMakeIntoPlayerEntity (struct Entity2D * pEnt, struct GameFrameworkLayer * pLayer, vec2 spawnAtGroundPos) |
| void | WfPlayerGetGroundContactPoint (struct Entity2D * pEnt, vec2 outPos) |
| void | WfPlayerPostPhys (struct Entity2D * pEnt, struct GameFrameworkLayer * pLayer, float deltaT) |
| 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) |
Public Static Functions
| Type | Name |
|---|---|
| void | ChangeItem (struct GameFrameworkLayer * pLayer, struct Entity2D * pEnt, struct WfPlayerEntData * pPlayerEntData, int incr) |
| void | GetMovementVector (u8 movementBits, vec2 movementVec) |
| static | OBJECT_POOL (struct WfPlayerEntData) |
| void | OnDestroyPlayer (struct Entity2D * pEnt, struct GameFrameworkLayer * pData) |
| void | OnInitPlayer (struct Entity2D * pEnt, struct GameFrameworkLayer * pLayer, DrawContext * pDrawCtx, InputContext * pInputCtx) |
| void | OnInputPlayer (struct Entity2D * pEnt, struct GameFrameworkLayer * pLayer, InputContext * context) |
| void | OnUpdatePlayer (struct Entity2D * pEnt, struct GameFrameworkLayer * pLayer, float deltaT) |
| void | SetBasePlayerActionAnimation (enum WfDirection dir, struct GameFrameworkLayer * pLayer, struct WfPlayerEntData * pPlayerEntData, struct Entity2D * pEnt) |
| void | SetBasePlayerAnimation (enum WfDirection dir, struct GameFrameworkLayer * pLayer, struct WfPlayerEntData * pPlayerEntData, struct Entity2D * pEnt) |
| void | SetPlayerAnimation (struct GameFrameworkLayer * pLayer, struct WfPlayerEntData * pPlayerEntData, struct Entity2D * pEnt) |
| void | SyncAnimA2B (struct AnimatedSprite * pA, struct AnimatedSprite * pB) |
| void | WfMakeIntoPlayerEntityBase (struct Entity2D * pEnt, struct GameFrameworkLayer * pLayer, vec2 spawnAtGroundPos, bool bNetworkControlled, int networkPlayerNum) |
| void | WfPrintPlayerInfo (struct Entity2D * pEnt) |
Macros
| Type | Name |
|---|---|
| define | SLASHING_DOWN_MALE "slash-base-male-down" |
| define | SLASHING_LEFT_MALE "slash-base-male-left" |
| define | SLASHING_RIGHT_MALE "slash-base-male-right" |
| define | SLASHING_UP_MALE "slash-base-male-up" |
| define | THRUSTING_DOWN_MALE "thrust-base-male-down" |
| define | THRUSTING_LEFT_MALE "thrust-base-male-left" |
| define | THRUSTING_RIGHT_MALE "thrust-base-male-right" |
| define | THRUSTING_UP_MALE "thrust-base-male-up" |
| define | WALKING_DOWN_FEMALE "walk-base-female-down" |
| define | WALKING_DOWN_MALE "walk-base-male-down" |
| define | WALKING_LEFT_FEMALE "walk-base-female-left" |
| define | WALKING_LEFT_MALE "walk-base-male-left" |
| define | WALKING_RIGHT_FEMALE "walk-base-female-right" |
| define | WALKING_RIGHT_MALE "walk-base-male-right" |
| define | WALKING_UP_FEMALE "walk-base-female-up" |
| define | WALKING_UP_MALE "walk-base-male-up" |
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 WfGetPlayerSortPosition
float WfGetPlayerSortPosition (
struct Entity2D * pEnt
)
function WfMakeIntoPlayerEntity
void WfMakeIntoPlayerEntity (
struct Entity2D * pEnt,
struct GameFrameworkLayer * pLayer,
vec2 spawnAtGroundPos
)
function WfPlayerGetGroundContactPoint
void WfPlayerGetGroundContactPoint (
struct Entity2D * pEnt,
vec2 outPos
)
function WfPlayerPostPhys
void WfPlayerPostPhys (
struct Entity2D * pEnt,
struct GameFrameworkLayer * pLayer,
float deltaT
)
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
)
Public Static Functions Documentation
function ChangeItem
static void ChangeItem (
struct GameFrameworkLayer * pLayer,
struct Entity2D * pEnt,
struct WfPlayerEntData * pPlayerEntData,
int incr
)
function GetMovementVector
static void GetMovementVector (
u8 movementBits,
vec2 movementVec
)
function OBJECT_POOL
static static OBJECT_POOL (
struct WfPlayerEntData
)
function OnDestroyPlayer
static void OnDestroyPlayer (
struct Entity2D * pEnt,
struct GameFrameworkLayer * pData
)
function OnInitPlayer
static void OnInitPlayer (
struct Entity2D * pEnt,
struct GameFrameworkLayer * pLayer,
DrawContext * pDrawCtx,
InputContext * pInputCtx
)
function OnInputPlayer
static void OnInputPlayer (
struct Entity2D * pEnt,
struct GameFrameworkLayer * pLayer,
InputContext * context
)
function OnUpdatePlayer
static void OnUpdatePlayer (
struct Entity2D * pEnt,
struct GameFrameworkLayer * pLayer,
float deltaT
)
function SetBasePlayerActionAnimation
static void SetBasePlayerActionAnimation (
enum WfDirection dir,
struct GameFrameworkLayer * pLayer,
struct WfPlayerEntData * pPlayerEntData,
struct Entity2D * pEnt
)
function SetBasePlayerAnimation
static void SetBasePlayerAnimation (
enum WfDirection dir,
struct GameFrameworkLayer * pLayer,
struct WfPlayerEntData * pPlayerEntData,
struct Entity2D * pEnt
)
function SetPlayerAnimation
static void SetPlayerAnimation (
struct GameFrameworkLayer * pLayer,
struct WfPlayerEntData * pPlayerEntData,
struct Entity2D * pEnt
)
function SyncAnimA2B
static void SyncAnimA2B (
struct AnimatedSprite * pA,
struct AnimatedSprite * pB
)
function WfMakeIntoPlayerEntityBase
static void WfMakeIntoPlayerEntityBase (
struct Entity2D * pEnt,
struct GameFrameworkLayer * pLayer,
vec2 spawnAtGroundPos,
bool bNetworkControlled,
int networkPlayerNum
)
function WfPrintPlayerInfo
static void WfPrintPlayerInfo (
struct Entity2D * pEnt
)
Macro Definition Documentation
define SLASHING_DOWN_MALE
#define SLASHING_DOWN_MALE `"slash-base-male-down"`
define SLASHING_LEFT_MALE
#define SLASHING_LEFT_MALE `"slash-base-male-left"`
define SLASHING_RIGHT_MALE
#define SLASHING_RIGHT_MALE `"slash-base-male-right"`
define SLASHING_UP_MALE
#define SLASHING_UP_MALE `"slash-base-male-up"`
define THRUSTING_DOWN_MALE
#define THRUSTING_DOWN_MALE `"thrust-base-male-down"`
define THRUSTING_LEFT_MALE
#define THRUSTING_LEFT_MALE `"thrust-base-male-left"`
define THRUSTING_RIGHT_MALE
#define THRUSTING_RIGHT_MALE `"thrust-base-male-right"`
define THRUSTING_UP_MALE
#define THRUSTING_UP_MALE `"thrust-base-male-up"`
define WALKING_DOWN_FEMALE
#define WALKING_DOWN_FEMALE `"walk-base-female-down"`
define WALKING_DOWN_MALE
#define WALKING_DOWN_MALE `"walk-base-male-down"`
define WALKING_LEFT_FEMALE
#define WALKING_LEFT_FEMALE `"walk-base-female-left"`
define WALKING_LEFT_MALE
#define WALKING_LEFT_MALE `"walk-base-male-left"`
define WALKING_RIGHT_FEMALE
#define WALKING_RIGHT_FEMALE `"walk-base-female-right"`
define WALKING_RIGHT_MALE
#define WALKING_RIGHT_MALE `"walk-base-male-right"`
define WALKING_UP_FEMALE
#define WALKING_UP_FEMALE `"walk-base-female-up"`
define WALKING_UP_MALE
#define WALKING_UP_MALE `"walk-base-male-up"`
The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/game/src/entities/WfPlayer.c