Path: blob/master/SonicMania/Objects/Helpers/CompetitionSession.h
338 views
#ifndef OBJ_COMPETITIONSESSION_H1#define OBJ_COMPETITIONSESSION_H23#include "Game.h"45#if !MANIA_USE_PLUS6// preplus was always 2P7#define COMPETITION_PLAYER_COUNT (2)89#define CompSession_DeriveWinner CompetitionSession_DeriveWinner10#else1112#define CompSession_DeriveWinner Competition_DeriveWinner13#endif1415#define COMPETITION_STAGE_COUNT (12)1617typedef enum {18FINISHTYPE_NOTFINISHED,19FINISHTYPE_GAMEOVER,20FINISHTYPE_PASSEDSIGNPOST,21} vsFinishFlags;2223typedef enum {24VS_BORDER_NONE,25VS_BORDER_BOTTOMRIGHT,26VS_BORDER_BOTTOM,27VS_BORDER_BOTTOMLEFT,28VS_BORDER_TOPRIGHT,29VS_BORDER_TOP,30VS_BORDER_TOPLEFT,31} vsScreenBorderTypes;3233// created so I can easily set up times in an array34typedef struct {35int32 minutes;36int32 seconds;37int32 milliseconds;38} vsTime;3940// Object Class41struct ObjectCompetitionSession {42RSDK_OBJECT43};4445// Entity Class46struct EntityCompetitionSession {47RSDK_ENTITY48bool32 inMatch;49int32 playerCount;50int32 stageIndex;51int32 zoneID;52int32 actID;53int32 matchID;54int32 matchCount;55int32 itemMode;56#if MANIA_USE_PLUS57int32 swapType;58#endif59bool32 completedStages[COMPETITION_STAGE_COUNT];60uint8 playerID[PLAYER_COUNT];61uint8 matchWinner[COMPETITION_STAGE_COUNT];62int32 rings[PLAYER_COUNT];63int32 score[PLAYER_COUNT];64int32 items[PLAYER_COUNT];65vsTime time[PLAYER_COUNT];66uint8 finishState[PLAYER_COUNT];67int32 totalRings[PLAYER_COUNT];68int32 wins[PLAYER_COUNT];69int32 lives[PLAYER_COUNT];70#if MANIA_USE_PLUS71int32 screenBorderType[SCREEN_COUNT];72int32 displayMode;73int32 inputSlots[PLAYER_COUNT];74int32 prevMatchID;75#endif76};7778// Object Entity79extern ObjectCompetitionSession *CompetitionSession;8081// Standard Entity Events82void CompetitionSession_Update(void);83void CompetitionSession_LateUpdate(void);84void CompetitionSession_StaticUpdate(void);85void CompetitionSession_Draw(void);86void CompetitionSession_Create(void *data);87void CompetitionSession_StageLoad(void);88#if GAME_INCLUDE_EDITOR89void CompetitionSession_EditorDraw(void);90void CompetitionSession_EditorLoad(void);91#endif92void CompetitionSession_Serialize(void);9394// Extra Entity Functions95EntityCompetitionSession *CompetitionSession_GetSession(void);9697#if !MANIA_USE_PLUS98void CompetitionSession_ResetOptions(void);99void CompetitionSession_ClearMatchData(void);100void CompetitionSession_DeriveWinner(int32 playerID, int32 finishType);101void CompetitionSession_WinMatchFor(int32 playerID);102#endif103104#endif //! OBJ_COMPETITIONSESSION_H105106107