1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-16 10:19:47 +02:00
Commit Graph

16 Commits

Author SHA1 Message Date
Ivan Savenko
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
Ivan Savenko
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
Ivan Savenko
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
Ivan Savenko
d5c4478816 Remove most of non-const access to VLC entities 2024-01-19 13:54:49 +02:00
Ivan Savenko
037efdf5fc Improvements to type safety of Identifier class
- Constructor of Identifier from integer is now explicit
- Lobby hero/town selection now uses Identifiers instead of int's
- Removed serialization workaround for hero portraits
- Added dummy objects for custom heroes portraits for ID resolver to use
- HeroInstance now stores portrait ID only in case of custom portrait
- Fixed loading of campaign heroes portraits on RoE maps
2023-10-04 18:05:23 +03:00
nordsoft
3024aaae30 Town picker in player settings implemented 2023-09-11 20:37:26 +02:00
nordsoft
19407954ed Object picker implemented 2023-09-11 20:37:26 +02:00
Ivan Savenko
e54287ea5d Converted remaining identifier to new system 2023-08-25 13:38:02 +03:00
Ivan Savenko
acac42291e Remove excessive CMap.h includes 2023-05-31 23:18:38 +03:00
nordsoft
1899dd97c7 Customize colors and teams 2023-04-30 12:49:45 +04:00
Konstantin
fedf7d377c vcmi: remove TFaction
This is a huge change and will break save compatibility
2023-04-10 19:28:16 +03:00
Andrey Filipenkov
8f638e7ca6 [editor] fix Player Settings crash when random town is added to a map
fixes #1714
2023-03-20 11:35:19 +03:00
Ivan Savenko
05a1d7c6e3 All text for factions/towns/building are passed through translator 2023-01-20 15:18:36 +02:00
nordsoft
b4a806d7fa Code polishing 2022-10-13 01:51:55 +04:00
Nordsoft91
23f80c58dc
Apply suggestions from code review
Co-authored-by: Andrey Filipenkov <decapitator@ukr.net>
2022-10-08 22:55:15 +04:00
nordsoft
0b9f601d2c Squashing editor 2022-09-18 03:23:17 +04:00