ReXGlue SDK
Loading...
Searching...
No Matches
title.h
Go to the documentation of this file.
1
13
14#pragma once
15
16#include <cstddef>
17#include <string>
18#include <vector>
19
20#include <rex/result.h>
21#include <rex/types.h>
22#include <rex/utility.h>
23
24namespace rex {
25
26struct VideoMode {
27 u32 width = 1280;
28 u32 height = 720;
29 f32 refresh_rate = 60.0f;
30};
31
33struct TitleInfo {
34 u32 title_id = 0;
35 VideoMode video_mode;
36};
37
39 u32 id = 0;
40 std::string label;
41 std::string description;
42 std::string unachieved_description;
43 std::string icon_path;
44 u32 image_id = 0;
45 u32 gamerscore = 0;
46 u32 flags = 0;
47 bool unlocked = false;
48 u64 unlock_time = 0;
49
51 const std::string& GetDescription() const {
52 return unlocked ? description : unachieved_description;
53 }
54};
55
57 public:
58 virtual ~IAchievementRegistry() = default;
59
65 virtual std::vector<Achievement> GetAchievements() = 0;
66
68 [[nodiscard]] virtual Result<std::vector<std::byte>> GetAchievementIcon(u32 image_id) = 0;
69
75 [[nodiscard]] virtual ScopeGuard OnAchievementUnlocked(
76 MoveOnlyFunction<void(const Achievement&)> fn) = 0;
77};
78
79} // namespace rex
Definition title.h:56
virtual std::vector< Achievement > GetAchievements()=0
virtual Result< std::vector< std::byte > > GetAchievementIcon(u32 image_id)=0
virtual ScopeGuard OnAchievementUnlocked(MoveOnlyFunction< void(const Achievement &)> fn)=0
Definition utility.h:305
Definition app.h:36
typename detail::MoveOnlyFunctionFor< Signature >::type MoveOnlyFunction
Definition utility.h:254
std::expected< T, Error > Result
Definition result.h:98
Definition title.h:38
const std::string & GetDescription() const
Definition title.h:51
u32 image_id
Definition title.h:44
u64 unlock_time
Definition title.h:48
Definition title.h:33
u32 title_id
Definition title.h:34
Definition title.h:26
Integer types, byte order wrappers and size literals.
Move only function, const propagating pointer and scope guard.