JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
Achievement.hpp
Go to the documentation of this file.
1
// Copyright 2023-2024 Jan Niklas Hasse <jhasse@bixense.com>
2
// For conditions of distribution and use, see copyright notice in LICENSE.txt
5
#pragma once
6
7
#include <
functional
>
8
#include <
string
>
9
10
namespace
jngl
{
11
12
class
Sprite
;
13
15
struct
Achievement
{
16
Achievement
(
std::string
id
,
std::string
name,
std::string
description,
std::string
icon
,
17
int
initialValue = 0,
int
maxValue = 1);
18
20
std::string
id
;
21
22
std::string
name;
23
std::string
description;
24
26
std::string
icon
;
27
28
int
maxValue;
29
30
int
getValue()
const
;
31
void
increaseValue(
int
by);
32
33
// if set "customDisplayValue(<value>) of customDisplayValue(<maxValue>)" will be displayed
34
std::function
<int(
int
)> customDisplayValue;
35
36
private
:
37
int
value;
38
};
39
40
}
// namespace jngl
std::string
jngl::Sprite
Higher-level representation of an image.
Definition
sprite.hpp:25
std::function
functional
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10
string
jngl::Achievement
Unlockable Achievement (also called Trophy)
Definition
Achievement.hpp:15
jngl::Achievement::icon
std::string icon
filename for achievement icon, will be loaded when the achievement is displayed
Definition
Achievement.hpp:26
jngl::Achievement::id
std::string id
API Name.
Definition
Achievement.hpp:20