2009-04-15 14:03:31 +00:00
|
|
|
/*
|
|
|
|
* CGameInfo.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
2009-04-16 11:14:13 +00:00
|
|
|
*/
|
2017-07-13 11:26:03 +03:00
|
|
|
#pragma once
|
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
#include <vcmi/Services.h>
|
|
|
|
|
2017-07-13 11:26:03 +03:00
|
|
|
#include "../lib/ConstTransitivePtr.h"
|
2009-04-16 11:14:13 +00:00
|
|
|
|
2022-07-26 16:07:42 +03:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
2012-08-10 13:07:53 +00:00
|
|
|
class CModHandler;
|
2009-04-16 11:14:13 +00:00
|
|
|
class CHeroHandler;
|
|
|
|
class CCreatureHandler;
|
|
|
|
class CSpellHandler;
|
2017-08-25 13:35:02 +12:00
|
|
|
class CSkillHandler;
|
2009-04-16 11:14:13 +00:00
|
|
|
class CBuildingHandler;
|
|
|
|
class CObjectHandler;
|
2014-05-24 01:56:51 +03:00
|
|
|
class CObjectClassesHandler;
|
2009-04-16 11:14:13 +00:00
|
|
|
class CTownHandler;
|
|
|
|
class CGeneralTextHandler;
|
|
|
|
class CConsoleHandler;
|
|
|
|
class CGameState;
|
2022-06-28 11:05:30 +03:00
|
|
|
class BattleFieldHandler;
|
2022-09-15 12:06:54 +04:00
|
|
|
class ObstacleHandler;
|
2022-09-21 11:34:23 +02:00
|
|
|
class TerrainTypeHandler;
|
2009-06-20 01:40:52 +00:00
|
|
|
|
2012-11-03 19:31:16 +00:00
|
|
|
class CMap;
|
|
|
|
|
2022-07-26 16:07:42 +03:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
|
|
|
class CMapHandler;
|
|
|
|
class CSoundHandler;
|
|
|
|
class CMusicHandler;
|
2023-01-05 19:34:37 +02:00
|
|
|
class CursorHandler;
|
2022-07-26 16:07:42 +03:00
|
|
|
class IMainVideoPlayer;
|
|
|
|
class CServerHandler;
|
2010-12-19 14:39:56 +00:00
|
|
|
|
|
|
|
//a class for non-mechanical client GUI classes
|
|
|
|
class CClientState
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSoundHandler * soundh;
|
|
|
|
CMusicHandler * musich;
|
|
|
|
CConsoleHandler * consoleh;
|
2023-01-05 19:34:37 +02:00
|
|
|
CursorHandler * curh;
|
2011-08-08 07:12:18 +00:00
|
|
|
IMainVideoPlayer * videoh;
|
2010-12-19 14:39:56 +00:00
|
|
|
};
|
2011-12-13 21:23:17 +00:00
|
|
|
extern CClientState * CCS;
|
2010-12-19 14:39:56 +00:00
|
|
|
|
2011-02-22 11:52:36 +00:00
|
|
|
/// CGameInfo class
|
|
|
|
/// for allowing different functions for accessing game informations
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
class CGameInfo : public Services
|
2009-04-16 11:14:13 +00:00
|
|
|
{
|
|
|
|
public:
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
const ArtifactService * artifacts() const override;
|
|
|
|
const CreatureService * creatures() const override;
|
|
|
|
const FactionService * factions() const override;
|
|
|
|
const HeroClassService * heroClasses() const override;
|
|
|
|
const HeroTypeService * heroTypes() const override;
|
2022-09-21 19:31:14 +03:00
|
|
|
#if SCRIPTING_ENABLED
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
const scripting::Service * scripts() const override;
|
2022-09-21 19:31:14 +03:00
|
|
|
#endif
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
const spells::Service * spells() const override;
|
|
|
|
const SkillService * skills() const override;
|
2022-06-28 11:05:30 +03:00
|
|
|
const BattleFieldService * battlefields() const override;
|
2022-09-15 12:06:54 +04:00
|
|
|
const ObstacleService * obstacles() const override;
|
2023-03-15 21:34:29 +02:00
|
|
|
const IGameSettings * settings() const override;
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
|
|
|
|
void updateEntity(Metatype metatype, int32_t index, const JsonNode & data) override;
|
|
|
|
|
|
|
|
const spells::effects::Registry * spellEffects() const override;
|
|
|
|
spells::effects::Registry * spellEffects() override;
|
|
|
|
|
2012-08-10 13:07:53 +00:00
|
|
|
ConstTransitivePtr<CModHandler> modh; //public?
|
2022-06-28 11:05:30 +03:00
|
|
|
ConstTransitivePtr<BattleFieldHandler> battleFieldHandler;
|
2010-12-19 14:39:56 +00:00
|
|
|
ConstTransitivePtr<CHeroHandler> heroh;
|
|
|
|
ConstTransitivePtr<CCreatureHandler> creh;
|
|
|
|
ConstTransitivePtr<CSpellHandler> spellh;
|
2017-08-25 13:35:02 +12:00
|
|
|
ConstTransitivePtr<CSkillHandler> skillh;
|
2010-12-19 14:39:56 +00:00
|
|
|
ConstTransitivePtr<CObjectHandler> objh;
|
2022-09-21 11:34:23 +02:00
|
|
|
ConstTransitivePtr<TerrainTypeHandler> terrainTypeHandler;
|
2014-05-24 01:56:51 +03:00
|
|
|
ConstTransitivePtr<CObjectClassesHandler> objtypeh;
|
2022-09-15 12:06:54 +04:00
|
|
|
ConstTransitivePtr<ObstacleHandler> obstacleHandler;
|
2010-12-17 18:47:07 +00:00
|
|
|
CGeneralTextHandler * generaltexth;
|
|
|
|
CMapHandler * mh;
|
|
|
|
CTownHandler * townh;
|
2009-04-16 11:14:13 +00:00
|
|
|
|
|
|
|
void setFromLib();
|
2010-08-16 09:54:09 +00:00
|
|
|
|
|
|
|
CGameInfo();
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
private:
|
|
|
|
const Services * globalServices;
|
2009-04-16 11:14:13 +00:00
|
|
|
};
|
2011-12-13 21:23:17 +00:00
|
|
|
extern const CGameInfo* CGI;
|