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

197 Commits

Author SHA1 Message Date
d3af9f1c67 Removed pointer to VLC entity from CStackBasicDescriptor 2024-10-30 16:47:02 +00:00
c98ac01e7a Replaced public artType member of ArtifactInstance with getter 2024-10-30 16:47:01 +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
29f393e024 Removed hardcoded checks for map objects in favor of analyzing
rewardable object content
2024-09-12 12:11:18 +00:00
503b87561e Converted all h3 banks to rewardable, remove most of hardcoded checks 2024-09-12 12:11:18 +00:00
97f1a310df Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00
1be36e1ad4 NKAI: rewardables 2024-07-07 21:58:39 +03:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
b4c6906471 Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-11 19:22:23 +00:00
b8beb4fb13 Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +00:00
7bf047ff18 #4066 - fix exploration 2024-06-01 13:13:51 +03:00
820f0e0c1a NKAI: port exploration from VCAI 2024-05-20 23:50:13 +03:00
1388fb1493 NKAI: port exploration from VCAI 2024-05-20 22:43:23 +03:00
721b15d9de Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-17 08:26:37 +00:00
98afd43969 #3941 - recruit hero when no heroes 2024-05-12 21:10:31 +03:00
30e0a16ee9 Fix some 'new' issues reported by Sonar Cloud 2024-05-06 15:33:30 +00:00
afa766c763 #3824 - fix cluster unlock 2024-04-27 10:57:30 +03:00
6e641dbdea #3824 - fix empty army with only commander issues 2024-04-26 23:18:20 +03:00
b4abb3a56c Merge pull request #3814 from vcmi/fixes
NKAI: fix patrolling heroes never retreat and town danger evaluation
2024-04-23 18:52:47 +03:00
e8e4446886 Simplify NKAI settings loading code 2024-04-22 11:14:58 +03:00
20f323d83c Added 'useTroopsFromGarrisons' option to NKAI 2024-04-22 11:14:57 +03:00
390136e536 NKAI: fix patrolling heroes never retreat and town danger evaluation 2024-04-21 14:23:58 +03:00
7aff0e63fc NKAI: fix parallel access to object graph 2024-04-21 12:27:58 +03:00
70fad45316 Merge pull request #3770 from vcmi/nkai-multitask
NKAI: allow multiple tasks to be executed from one calculation
2024-04-20 15:21:11 +03:00
3939c4b9d3 NKAI: stability fixes and regression 2024-04-20 14:32:58 +03:00
7d925b3689 Fix typo: Preasure -> Pressure 2024-04-16 21:10:15 +00:00
ed76d8a652 NKAI: allow multiple tasks to be executed from one calculation 2024-04-14 16:46:05 +03:00
728f673763 NKAI: remove static ai field 2024-03-31 21:11:25 +03:00
d6f1a5c2b3 NKAI: parallel capture objects 2024-03-29 20:39:03 +02:00
6245adb9a4 NKAI: configurable object graph 2024-03-08 14:39:16 +02:00
5f8a157c6d NKAI: rollback changes with removing scan depth 2024-03-03 10:21:17 +02:00
b236384356 NKAI: graph add battle layer 2024-03-02 15:54:05 +02:00
a090441672 NKAI: object graph second layer not operational yet 2024-03-02 15:54:03 +02:00
376a17409f NKAI: initial implementation of object graph 2024-03-02 15:52:45 +02:00
35429eab52 NKAI: moddable configuration 2024-03-01 22:03:07 +02:00
678cacbd25 Remove more redundant virtual specifiers
`grep -nr "virtual " | grep -v googletest | grep " override" | grep -v overriden > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":",2)
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-13 15:21:30 +01:00
0c1664dbe7 NKAI: various AI fixes after tests in headless 2024-01-20 22:55:30 +02:00
1db43a509e NKAI: fix casting FLY several times during path calculation 2024-01-20 22:55:28 +02:00
36bc9ddcec NKAI: mutex for internal AI state 2024-01-20 22:55:27 +02:00
cc7fc4a2c6 Fix headless mode 2024-01-20 22:55:27 +02:00
d04241b10a Code cleanup 2024-01-19 23:02:00 +02:00
60ffb81b33 Replaced remaining placeholder code with callbacks 2024-01-19 13:55:22 +02:00
a15366f5a5 Make IObjectInterface::cb non-static 2024-01-19 13:55:21 +02:00
f3277b7953 Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
8346d71c98 Remove more subID access 2023-11-01 14:44:05 +02:00
5cbc75d3b7 Merge remote-tracking branch 'upstream/develop' into develop 2023-10-29 13:35:37 +00:00
0a6c82c639 AI/Nullkiller/Behaviors/DefenceBehavior.{h,cpp}: treat -> threat 2023-10-27 23:34:11 +00:00
9eb9404f28 BattleAI: divide only positive part of score onto turns count 2023-10-22 21:37:54 +03: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