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-2025 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
46 int initialValue = 0, int maxValue = 1);
47
50
51 std::string name;
52 std::string description;
53
56
57 int maxValue;
58
59 int getValue() const;
60 void increaseValue(int by);
61
62 // if set "customDisplayValue(<value>) of customDisplayValue(<maxValue>)" will be displayed
63 std::function<int(int)> customDisplayValue;
64
65private:
66 int value;
67};
68
69} // namespace jngl
Higher-level representation of an image.
Definition Sprite.hpp:26
JNGL's main namespace.
Represents one unlockable Achievement (aka Trophy)
Achievement(std::string id, std::string name, std::string description, std::string icon, int initialValue=0, int maxValue=1)
The id must match the ID you set in Steamworks (if you use Steam, otherwise it's unused).
std::string icon
filename for achievement icon, will be loaded when the achievement is displayed
std::string id
API Name.