1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Commit Graph

53 Commits

Author SHA1 Message Date
e829d723b2 Replace global bonus tree change counter with per-node counter 2025-01-12 12:23:07 +00:00
39d2f27589 Remove remaining usages of CCheckProxy class 2025-01-04 15:09:50 +00:00
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +00:00
3dd4fa2528 Reduce usage of pointers to VLC entities
Final goal (of multiple PR's) is to remove all remaining pointers from
serializeable game state, and replace them with either identifiers or
with shared/unique pointers.

CGTownInstance::town and CGHeroInstance::type members have been removed.
Now this data is computed dynamically using subID member.

VLC entity of a town can now be accessed via following methods:
- getFactionID() returns ID of a faction
- getFaction() returns pointer to a faction
- getTown() returns pointer to a town

VLC entity of a hero can now be accessed via following methods:
- getHeroTypeID() returns ID of a hero
- getHeroClassID() returns ID of a hero class
- getHeroType() returns pointer to a hero
- getHeroClass() returns pointer to a hero class
2024-10-10 12:28:08 +00:00
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
1aa391fdf8 Split CGeneralTextHandler file into 1 file per class form
All text processing code is now located in lib/texts.
No changes other than code being moved around and adjustment of includes

Moved without changes:
Languages.h           -> texts/Languages.h
MetaString.*          -> texts/MetaString.*
TextOperations.*      -> texts/TextOperations.*

Split into parts:
CGeneralTextHandler.* -> texts/CGeneralTextHandler.*
                      -> texts/CLegacyConfigParser.*
                      -> texts/TextLocalizationContainer.*
                      -> texts/TextIdentifier.h
2024-07-20 12:55:17 +00:00
42616cf4e8 Fix text formatting, fix todo's 2024-04-09 16:13:30 +03:00
9e49587749 Replace bonus string description with metastring that can properly
handle translations
2024-04-09 16:13:30 +03:00
a15366f5a5 Make IObjectInterface::cb non-static 2024-01-19 13:55:21 +02:00
39c3db04f3 Add missing antimagic functionality to antimagic garrisons 2023-12-21 18:09:33 +01:00
664da58d4f Use MetaString in place of boost::format to avoid exceptions 2023-12-13 17:23:40 +02:00
abad4b01ce Remove explicit convesion to int in operators 2023-11-15 15:55:19 +02:00
a574f18e69 #2903-morale-description-#1442 2023-11-10 15:58:19 +01:00
5487f07d3b added toEntity overload that accepts generic Services class 2023-11-04 17:04:53 +02:00
184f5a72cc Use toEntity/toXXX methods in Identifier instead VLC objects access 2023-11-03 16:03:29 +02:00
885dce0c27 Replace static_cast's of Identifiers with getNum call 2023-11-03 16:03:29 +02:00
ac925bb786 Renamed new types for consistency with code style 2023-10-22 16:55:19 +03:00
80e6485965 MetaIdentifier now uses std::variant internally 2023-10-22 16:55:19 +03:00
b394158dc9 Bonus Source ID now uses metaidentifier 2023-10-22 16:55:18 +03:00
2960895041 Issues fixed 2023-09-17 22:19:45 +02:00
ce20d913e0 Fix checking PlayerColor's for validness 2023-08-27 01:35:38 +03:00
85262cf4f5 Moved CGameState files into a separate directory 2023-06-26 17:15:59 +03:00
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
3738171b21 Refactoring of H3M loader to make HotA format support easier
- extracted low-level reader from MapFormatH3M class
- added separate structure to define version-specific values
- cleared up some H3M format edge cases
- replaced witch hut skill vector with set
- converted several fields to enum type
2023-04-15 17:20:38 +03:00
fedf7d377c vcmi: remove TFaction
This is a huge change and will break save compatibility
2023-04-10 19:28:16 +03:00
11b237a23c vcmi: massive refactoring v1 2023-04-05 22:33:12 +03:00
8968f0ef0e vcmi: change EAlignment to enum class 2023-04-05 01:22:04 +03:00
5f181e25af vcmi: modernize lib/mapObjects 2023-02-14 14:39:56 +03:00
0f35082024 Fix crash with objects belonging players without state 2022-11-06 03:26:13 +04:00
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
d0f857c3c4 - Generate caching string with sprintf
- Reserve BonusList space to avoid costly vector reallocation
- Tweaks in int3 and UNDEAD bonus
2022-09-14 11:00:40 +02:00
d47564955e Nullkiller: fix/refactor temporary bonus nodes, fix gather army quest completion 2021-07-26 21:02:50 +03:00
3fa7e0976f Nullkiller: update / fix build, core changes required for Nullkiller AI 2021-07-26 21:02:50 +03:00
ecaa9f5d0b 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.
2021-02-14 19:05:43 +03:00
39de2f6435 Fix: Morale bonus should be shown correctly 2020-11-11 22:43:40 +03:00
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
d782ee39df hacks to optimize a few bonus requests 2020-07-04 17:52:22 +03:00
2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
dd1aabbe23 Use JsonSerializeFormat for map objects 2016-02-22 02:37:19 +03:00
6db94ab74c Explicit army serialization - too much CArmedInstance descendants 2016-02-09 10:11:59 +03:00
f9d0b20234 CGMine, CGArtifact, CGGarrison serialization 2016-01-23 19:53:02 +03:00
b0c4ea5947 Fix. 2016-01-23 17:43:20 +03:00
a638d0cd51 Creature set serialization 2016-01-15 20:24:17 +03:00
37d0dad70a Merge branch 'develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CArtHandler.cpp
2016-01-01 20:28:52 +03:00
59199ccdbd Bonus system: add treeHasChanged call where bonus objects changed 2015-12-11 16:13:18 +03:00
1730a31471 HeroBonus: get rid of code that used getBonusList 2015-12-11 16:01:51 +03:00
b56b7017ba Added stubs for some Map objects serialization 2015-12-05 12:38:35 +03:00
7b5a7f43ad Removed includes of CGameState from headers 2015-12-02 21:39:53 +02:00
8f2da66a18 fix mantiss 1967 + some refactoring
* remove TModDescr and realted APIs - they were only used in one place
2015-09-04 22:29:20 +03:00