SuperMarioOdysseyOnline/include/server/hns/HideAndSeekMode.hpp

46 lines
1.4 KiB
C++
Raw Normal View History

2022-06-16 21:33:18 +00:00
#pragma once
#include <math.h>
#include "al/camera/CameraTicket.h"
2022-08-07 21:42:56 +00:00
#include "server/gamemode/GameModeBase.hpp"
#include "server/gamemode/GameModeInfoBase.hpp"
2022-06-16 21:33:18 +00:00
#include "server/gamemode/GameModeConfigMenu.hpp"
#include "server/gamemode/GameModeTimer.hpp"
2022-08-07 21:42:56 +00:00
#include "server/hns/HideAndSeekConfigMenu.hpp"
2022-06-16 21:33:18 +00:00
struct HideAndSeekInfo : GameModeInfoBase {
HideAndSeekInfo() { mMode = GameMode::HIDEANDSEEK; }
bool mIsPlayerIt = false;
bool mIsUseGravity = false;
bool mIsUseGravityCam = false;
GameTime mHidingTime;
};
class HideAndSeekMode : public GameModeBase {
public:
HideAndSeekMode(const char* name);
void init(GameModeInitInfo const& info) override;
virtual void begin() override;
virtual void update() override;
virtual void end() override;
bool isPlayerIt() const { return mInfo->mIsPlayerIt; };
void setPlayerTagState(bool state) { mInfo->mIsPlayerIt = state; }
void enableGravityMode() {mInfo->mIsUseGravity = true;}
void disableGravityMode() { mInfo->mIsUseGravity = false; }
bool isUseGravity() const { return mInfo->mIsUseGravity; }
void setCameraTicket(al::CameraTicket *ticket) {mTicket = ticket;}
private:
float mInvulnTime = 0.0f;
GameModeTimer* mModeTimer = nullptr;
HideAndSeekIcon *mModeLayout = nullptr;
HideAndSeekInfo* mInfo = nullptr;
al::CameraTicket *mTicket = nullptr;
};