JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
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
10namespace jngl {
11
12class Sprite;
13
17 int initialValue = 0, int maxValue = 1);
18
21
22 std::string name;
23 std::string description;
24
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
36private:
37 int value;
38};
39
40} // namespace jngl
Higher-level representation of an image.
Definition sprite.hpp:25
JNGL's main namespace.
Unlockable Achievement (also called Trophy)
std::string icon
filename for achievement icon, will be loaded when the achievement is displayed
std::string id
API Name.