2009-04-15 17:03:31 +03: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 14:14:13 +03:00
|
|
|
*/
|
2017-07-13 10:26:03 +02: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 16:58:30 +02:00
|
|
|
#include <vcmi/Services.h>
|
|
|
|
|
2017-07-13 10:26:03 +02:00
|
|
|
#include "../lib/ConstTransitivePtr.h"
|
2009-04-16 14:14:13 +03:00
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
2012-08-10 16:07:53 +03:00
|
|
|
class CModHandler;
|
2009-04-16 14:14:13 +03:00
|
|
|
class CHeroHandler;
|
|
|
|
class CCreatureHandler;
|
|
|
|
class CSpellHandler;
|
2017-08-25 03:35:02 +02:00
|
|
|
class CSkillHandler;
|
2009-04-16 14:14:13 +03:00
|
|
|
class CBuildingHandler;
|
|
|
|
class CObjectHandler;
|
2014-05-24 01:56:51 +03:00
|
|
|
class CObjectClassesHandler;
|
2009-04-16 14:14:13 +03:00
|
|
|
class CTownHandler;
|
|
|
|
class CGeneralTextHandler;
|
|
|
|
class CConsoleHandler;
|
|
|
|
class CGameState;
|
2022-06-28 10:05:30 +02:00
|
|
|
class BattleFieldHandler;
|
2022-09-15 10:06:54 +02:00
|
|
|
class ObstacleHandler;
|
2022-09-21 11:34:23 +02:00
|
|
|
class TerrainTypeHandler;
|
2009-06-20 04:40:52 +03:00
|
|
|
|
2012-11-03 22:31:16 +03:00
|
|
|
class CMap;
|
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
|
|
|
class CMapHandler;
|
|
|
|
class CSoundHandler;
|
|
|
|
class CMusicHandler;
|
2023-01-05 19:34:37 +02:00
|
|
|
class CursorHandler;
|
2022-07-26 15:07:42 +02:00
|
|
|
class IMainVideoPlayer;
|
|
|
|
class CServerHandler;
|
2010-12-19 16:39:56 +02: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 10:12:18 +03:00
|
|
|
IMainVideoPlayer * videoh;
|
2010-12-19 16:39:56 +02:00
|
|
|
};
|
2011-12-14 00:23:17 +03:00
|
|
|
extern CClientState * CCS;
|
2010-12-19 16:39:56 +02:00
|
|
|
|
2011-02-22 13:52:36 +02: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 16:58:30 +02:00
|
|
|
class CGameInfo : public Services
|
2009-04-16 14:14:13 +03: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 16:58:30 +02: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 18:31:14 +02: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 16:58:30 +02:00
|
|
|
const scripting::Service * scripts() const override;
|
2022-09-21 18:31:14 +02: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 16:58:30 +02:00
|
|
|
const spells::Service * spells() const override;
|
|
|
|
const SkillService * skills() const override;
|
2022-06-28 10:05:30 +02:00
|
|
|
const BattleFieldService * battlefields() const override;
|
2022-09-15 10:06:54 +02:00
|
|
|
const ObstacleService * obstacles() 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 16:58:30 +02: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 16:07:53 +03:00
|
|
|
ConstTransitivePtr<CModHandler> modh; //public?
|
2022-06-28 10:05:30 +02:00
|
|
|
ConstTransitivePtr<BattleFieldHandler> battleFieldHandler;
|
2010-12-19 16:39:56 +02:00
|
|
|
ConstTransitivePtr<CHeroHandler> heroh;
|
|
|
|
ConstTransitivePtr<CCreatureHandler> creh;
|
|
|
|
ConstTransitivePtr<CSpellHandler> spellh;
|
2017-08-25 03:35:02 +02:00
|
|
|
ConstTransitivePtr<CSkillHandler> skillh;
|
2010-12-19 16:39:56 +02: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 10:06:54 +02:00
|
|
|
ConstTransitivePtr<ObstacleHandler> obstacleHandler;
|
2010-12-17 20:47:07 +02:00
|
|
|
CGeneralTextHandler * generaltexth;
|
|
|
|
CMapHandler * mh;
|
|
|
|
CTownHandler * townh;
|
2009-04-16 14:14:13 +03:00
|
|
|
|
|
|
|
void setFromLib();
|
2010-08-16 12:54:09 +03: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 16:58:30 +02:00
|
|
|
private:
|
|
|
|
const Services * globalServices;
|
2009-04-16 14:14:13 +03:00
|
|
|
};
|
2011-12-14 00:23:17 +03:00
|
|
|
extern const CGameInfo* CGI;
|