1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-04 09:42:40 +02:00
Commit Graph

11 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
godric3
514e81406d extract PlayerColor to QString conversion to helper function 2024-09-17 20:57:05 +02:00
godric3
9baccdeeae map editor: fix event players after conversion to std::set 2024-09-16 20:25:19 +02:00
godric3
8917c753bd adjust town event handling after introducing 8th creature in town 2024-09-16 20:16:36 +02:00
godric3
e782d3984f fix some sonarcloud issues 2024-08-01 23:31:06 +02:00
godric3
27f83449f2 PR review fixes:
- change return of `getBuildingVariantsFromModel` to `QVariantList`
- change while to do-while where it makes sense
- moved constants outside of methods
- made building and resources name non editable
2024-08-01 22:36:01 +02:00
godric3
3fb3fef16b use range constructor or QVariantList::fromStdList based on Qt version 2024-07-29 19:03:17 +02:00
godric3
2b9461ed6e use custom roles instead of Qt::UserRole 2024-07-28 22:58:06 +02:00
godric3
d540ee1887 extract magic numbers to constants 2024-07-28 22:57:44 +02:00
godric3
67ab43526f reduce code duplication 2024-07-28 16:28:21 +02:00
godric3
3d3f388fb8 rename TownEvent to TownEventDialog 2024-07-28 16:28:21 +02:00