mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
41 lines
679 B
C++
Executable File
41 lines
679 B
C++
Executable File
|
|
#include "PlayerProtocol.h"
|
|
#include "base/ccMacros.h"
|
|
|
|
PLAYER_NS_BEGIN
|
|
|
|
PlayerProtocol *PlayerProtocol::_instance = nullptr;
|
|
|
|
PlayerProtocol::PlayerProtocol()
|
|
{
|
|
CCASSERT(_instance == nullptr, "CAN NOT CREATE MORE PLAYER INSTANCE");
|
|
_instance = this;
|
|
}
|
|
|
|
PlayerProtocol::~PlayerProtocol()
|
|
{
|
|
_instance = nullptr;
|
|
}
|
|
|
|
PlayerProtocol *PlayerProtocol::getInstance()
|
|
{
|
|
return _instance;
|
|
}
|
|
|
|
void PlayerProtocol::purgeInstance()
|
|
{
|
|
if (_instance) delete _instance;
|
|
}
|
|
|
|
void PlayerProtocol::setPlayerSettings(const PlayerSettings &settings)
|
|
{
|
|
_settings = settings;
|
|
}
|
|
|
|
PlayerSettings PlayerProtocol::getPlayerSettings() const
|
|
{
|
|
return _settings;
|
|
}
|
|
|
|
PLAYER_NS_END
|