Etterna 0.74.4
Loading...
Searching...
No Matches
GameManager.h
1
3#ifndef GAMEMANAGER_H
4#define GAMEMANAGER_H
5
6class Style;
7struct Game;
8struct lua_State;
9
10#include "Etterna/Models/Misc/GameConstantsAndTypes.h"
11
14{
15 const char* szName;
22 StepsTypeCategory m_StepsTypeCategory;
23 [[nodiscard]] auto GetLocalizedString() const -> std::string;
24};
25
27{
28 public:
31
32 void GetStylesForGame(const Game* pGame,
33 std::vector<const Style*>& aStylesAddTo,
34 bool editor = false);
35 auto GetGameForStyle(const Style* pStyle) -> const Game*;
36 void GetStepsTypesForGame(const Game* pGame,
37 std::vector<StepsType>& aStepsTypeAddTo);
38 auto GetEditorStyleForStepsType(StepsType st) -> const Style*;
39 auto GetStyleForStepsType(StepsType st) -> const Style*;
40 void GetDemonstrationStylesForGame(const Game* pGame,
41 std::vector<const Style*>& vpStylesOut);
42 auto GetHowToPlayStyleForGame(const Game* pGame) -> const Style*;
43 void GetCompatibleStyles(const Game* pGame,
44 int iNumPlayers,
45 std::vector<const Style*>& vpStylesOut);
46 auto GetFirstCompatibleStyle(const Game* pGame,
47 int iNumPlayers,
48 StepsType st) -> const Style*;
49
50 void GetEnabledGames(std::vector<const Game*>& aGamesOut);
51 auto GetDefaultGame() -> const Game*;
52 auto IsGameEnabled(const Game* pGame) -> bool;
53 auto GetIndexFromGame(const Game* pGame) -> int;
54 auto GetGameFromIndex(int index) -> const Game*;
55
56 auto GetStepsTypeInfo(StepsType st) -> const StepsTypeInfo&;
57 auto StringToStepsType(std::string sStepsType) -> StepsType;
58 auto StringToGame(const std::string& sGame) -> const Game*;
59 auto GameAndStringToStyle(const Game* pGame, const std::string& sStyle)
60 -> const Style*;
61 auto StyleToLocalizedString(const Style* s) -> std::string;
62
63 bool m_bResetModifiers;
64 bool m_bResetTurns;
65 float m_fPreviousRate;
66 std::string m_sModsToReset;
67 std::vector<std::string> m_vTurnsToReset;
68
69 // Lua
70 void PushSelf(lua_State* L);
71};
72
73extern GameManager*
74 GAMEMAN; // global and accessible from anywhere in our program
75
76#endif
Definition GameManager.h:27
Definition Style.h:22
Holds information about a particular style of a game (e.g. "single", "double").
Definition Game.h:33
The collective information about a Steps' Type.
Definition GameManager.h:14
int iNumTracks
The number of tracks, or columns, of this type.
Definition GameManager.h:17
StepsTypeCategory m_StepsTypeCategory
The most basic StyleType that this StpesTypeInfo is used with.
Definition GameManager.h:22
bool bAllowAutogen
A flag to determine if we allow this type to be autogen'ed to other types.
Definition GameManager.h:20