mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Add a basic achievements manager.
This commit is contained in:
parent
f6f8fb3d27
commit
8051ceaa43
@ -22,6 +22,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake)
|
||||
|
||||
set(SERVER_FILES
|
||||
TracyAchievements.cpp
|
||||
TracyBadVersion.cpp
|
||||
TracyColor.cpp
|
||||
TracyEventDebug.cpp
|
||||
|
32
profiler/src/profiler/TracyAchievements.cpp
Normal file
32
profiler/src/profiler/TracyAchievements.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "TracyAchievements.hpp"
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
AchievementsMgr::AchievementsMgr()
|
||||
{
|
||||
m_queue.emplace_back( "Discover achievements!" );
|
||||
m_queue.emplace_back( "Achievements are fun!" );
|
||||
m_queue.emplace_back( "The new beginnings are always the best!" );
|
||||
}
|
||||
|
||||
const std::string* AchievementsMgr::GetNextQueue()
|
||||
{
|
||||
if( m_queue.empty() ) return nullptr;
|
||||
return &m_queue.front();
|
||||
}
|
||||
|
||||
void AchievementsMgr::PopQueue()
|
||||
{
|
||||
assert( !m_queue.empty() );
|
||||
m_queue.erase( m_queue.begin() );
|
||||
}
|
||||
|
||||
bool AchievementsMgr::NeedsUpdates() const
|
||||
{
|
||||
return !m_queue.empty();
|
||||
}
|
||||
|
||||
}
|
26
profiler/src/profiler/TracyAchievements.hpp
Normal file
26
profiler/src/profiler/TracyAchievements.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef __TRACYACHIEVEMENTS_HPP__
|
||||
#define __TRACYACHIEVEMENTS_HPP__
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
class AchievementsMgr
|
||||
{
|
||||
public:
|
||||
AchievementsMgr();
|
||||
|
||||
const std::string* GetNextQueue();
|
||||
void PopQueue();
|
||||
|
||||
bool NeedsUpdates() const;
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_queue;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user