1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-19 22:23:31 +02:00

88 Commits

Author SHA1 Message Date
Ivan Savenko
9dfef773e2 Remove unnecessary includes 2025-05-19 17:56:46 +03:00
Ivan Savenko
c0850f41b3 Pathfinder now uses IGameInfoCallback instead of CGameState 2025-05-19 17:53:15 +03:00
Ivan Savenko
fe2f5f9217 Pathfinder now uses CGameState directly instead of inheriting callback 2025-05-19 17:53:15 +03:00
Ivan Savenko
4d4da0454f map objects hierarchy now uses IGameInfoCallback 2025-05-14 18:33:20 +03:00
Ivan Savenko
6f20235d07 Merge CPrivilegedInfoCallback into CGameInfoCallback 2025-05-14 13:42:20 +03:00
Ivan Savenko
716da918f8 Completely remove IGameCallback class
- CClient now inherits directly from CPrivilegedInfoCallback, like
IGameCallback did before. However CClient no longer needs dummy
implementation of IGameEventCallback
- CGObjectInstance hierarchy now uses CPrivilegedInfoCallback for
callback. Actual events can only be emitted in calls that receive
IGameEventCallback pointer, e.g. heroVisit
- CGameHandler now inherits directly from both CPrivilegedInfoCallback
and IGameEventCallback as it did before via IGameCallback
2025-05-14 13:39:41 +03:00
Ivan Savenko
1f15a7faa4 Fix build 2025-05-12 22:07:10 +03:00
Ivan Savenko
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
Ivan Savenko
829739da24 Reduce usage of implicit conversions to int 2025-04-27 14:57:31 +03:00
Ivan Savenko
4d57a8ed36 Prefer to pass CGameState as reference instead of pointer 2025-04-27 14:57:31 +03:00
Ivan Savenko
9e6397d1f9 Remove pointer to boat from CGHeroInstance 2025-04-27 14:57:30 +03:00
Ivan Savenko
cd7732456a Remove pointer to objects from TerrainTile 2025-04-27 14:57:30 +03:00
Ivan Savenko
ab11d2b075 Remove quests from CMap, now solely owned by quest objects 2025-04-27 14:57:30 +03:00
Ivan Savenko
797646cc05 Quests in map now use shared_ptr instead of const ptr 2025-04-27 14:57:30 +03:00
Ivan Savenko
417ea6451a Remove ConstTransitivePtr from hero and town instances 2025-04-27 14:57:30 +03:00
Ivan Savenko
62cb5412ff CGameState::map is now a private, unique_ptr with accessors 2025-03-08 14:05:14 +00:00
Ivan Savenko
4a6a8f9496
Merge pull request #5496 from IvanSavenko/std_thread
Replace boost::thread with std::thread
2025-03-08 16:03:55 +02:00
Ivan Savenko
9f713a0914 Rename int3::valid to isValid for consistency 2025-03-03 10:46:00 +00:00
Ivan Savenko
3d205e0291 Remove CThreadHelper class, final usage replaced with tbb 2025-03-02 14:33:11 +00:00
Ivan Savenko
ec970c7b22 Support for configuring minimal cost for moving between tiles
- Added `movementCostBase` parameter to game config that defines minimal
amount of movement points that will be spent when moving from one tile
on another while offroad (and cost of Fly / Town Portal spells)
- Added `BASE_TILE_MOVEMENT_COST` bonus type that allows modifying
`movementCostBase` on per-hero basis

Example usage for hota-like pathfinding skill
```json
"tileCostReduction" : {
	"type" : "BASE_TILE_MOVEMENT_COST",
	"val" : -15
}
```
2025-02-03 22:52:33 +00:00
Ivan Savenko
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
Ivan Savenko
8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
Ivan Savenko
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
Ivan Savenko
40f17d654d Use containers with pre-allocations to improve pathfinding speed 2024-07-03 18:06:56 +00:00
Alexander Wilms
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
Andrii Danylchenko
017fb204a1 NKAI: remove 5th dimension 2024-03-24 09:32:54 +02:00
Ivan Savenko
c23953eac5 Remove custom casts 2024-02-14 12:56:37 +02:00
Alexander Wilms
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
Alexander Wilms
522cb571b3 Remove redundant virtual specifiers
`grep -nr virtual | grep -v googletest | grep override > ../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(":")
        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-10 20:46:13 +01:00
Ivan Savenko
bd5682ecc3 Merge remote-tracking branch 'vcmi/master' into develop 2024-01-19 13:49:54 +02:00
Ivan Savenko
8303ce5d13 Added option to ignore guards in pathfinder
Used for simturns contact detection, by default disabled for player
pathfinding
2024-01-13 19:44:37 +02:00
Joakim Thorén
406d136cdc Fixes warnings about possibly dangling references 2023-12-27 22:24:58 +01:00
Ivan Savenko
8346d71c98 Remove more subID access 2023-11-01 14:44:05 +02:00
Ivan Savenko
0a10fc30b8 (lib) Bonus subtype is now stored as metaidentifier that can store any
other identifier inside it
2023-10-22 16:54:43 +03:00
Johannes Schauer Marin Rodrigues
f9e1b302c7
some spelling fixes 2023-10-18 01:41:02 +02:00
Ivan Savenko
e0ea994656 Moved some pathfinding options to game settings 2023-06-25 17:42:36 +03:00
Ivan Savenko
08cfbe79cf Added encapsulation for movement points access 2023-06-25 17:42:36 +03:00
Ivan Savenko
ebc7a82c2e Converted pathfinder enum's to enum class 2023-06-21 15:38:57 +03:00
Ivan Savenko
f78470a301 Fix build 2023-06-21 14:55:25 +03:00
Ivan Savenko
bd4d2788ed Split pathfinder into multiple smaller files 2023-06-21 13:46:09 +03:00
Ivan Savenko
87fcfa4add Removed excessive pathfinder includes 2023-06-21 12:00:44 +03:00
Ivan Savenko
acac42291e Remove excessive CMap.h includes 2023-05-31 23:18:38 +03:00
Konstantin
86f5d6de69 vcmi: modernize headers 2023-04-30 13:35:54 +03:00
Konstantin
7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
Andrey Filipenkov
3602645a30 improve iterating over EPathfindingLayer 2023-03-20 11:35:19 +03:00
Ivan Savenko
fa6f7513e8 All heroes-related strings are passed through translator 2023-01-20 15:18:36 +02:00
Ivan Savenko
908e6892f3 Removed CGHeroInstance::getPosition pseudo-override
Now access to hero visible position is always done via visitablePos
2022-12-07 22:10:08 +02:00
Tomasz Zieliński
97a94ce61e Handle Tile by reference instead of pointer 2022-09-25 08:04:15 +02:00
Tomasz Zieliński
494b0f0226 First version that compiles 2022-09-21 11:34:23 +02:00
DjWarmonger
7ba271edf1
Rotation rebase2 (#912)
* Instead of [x][y][z] coordinates, map will be stored as [z][x][y].
* Nullkiller AI can get it too.
* Use boost::multi_array instead of nested vectors
* In MapHandler too
* Rotate foreach algorithms, too
* VCAI gets rotated, too
2022-09-18 17:39:10 +03:00