1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-04-26 20:02:20 +02:00

78 Commits

Author SHA1 Message Date
Laserlicht 134c145b98 convert ResourceSet to std::map 2025-09-15 23:48:55 +02:00
Laserlicht acd067e587 remove CObjectHandler 2025-09-14 21:34:32 +02:00
Andrey Filipenkov 8add24a87d [cmake] rename iOS and macOS variables 2025-08-30 21:50:00 +03:00
Ivan Savenko e12765dca0 Fix sonar warnings, convert spaces -> tabs 2025-07-09 17:52:51 +03:00
Ivan Savenko 8721bdd728 Split CCreatureSet file on .h/.cpp per class basis 2025-07-07 19:12:31 +03:00
Ivan Savenko 1e3e2f665c Remove strange & unused double-selector logic 2025-06-24 12:06:23 +03:00
Ivan Savenko 51832c4fb9 Preparation for user-defined bonus types 2025-06-15 14:36:29 +03:00
Ivan Savenko 456525109e Replaced undescriptive bool true/false with more clear enum for
absolute/relative change via netpacks
2025-05-16 17:21:39 +03:00
Ivan Savenko 4d4da0454f map objects hierarchy now uses IGameInfoCallback 2025-05-14 18:33:20 +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 93b18ee94b Fix some issues detected by Sonar & code review, fix build 2025-04-27 14:57:31 +03:00
Laserlicht 7dfb499edf replace boost locks with std 2025-02-28 15:25:58 +01:00
MichalZr6 dbe82b94f6 Changes following review:
- shared_ptr for destructibleEnemyTurns instead of raw pointer
- drop implicit int conversion for BattleHex class
  and implement toInt() instead
- implement necessary operators in BattleHex
- adjust code to work properly with JSON serializer
2025-01-08 07:24:43 +01:00
MichalZr6 4031006317 Drop battle elapsed time measurement, restore avHexes.
Github validation report fixes.
2025-01-06 23:28:47 +01:00
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 d0606d2dc9 Fix scripting build 2024-10-07 15:14:03 +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
Ivan Savenko 5d6470e527 Merge pull request #4025 from IvanSavenko/shared_ptr_lib
[1.6] Use shared_ptr for library entities
2024-05-30 19:14:06 +03: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 eb67e04ccb Remove old and unmaintained codeblocks project 2024-05-17 10:44:57 +00:00
Ivan Savenko 8aaa9e63dd Fix build 2024-04-09 18:56:28 +03:00
Evgeny Malygin 25125f96da Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
Alexander Wilms ea48257100 Fix SonarCloud issues
Replace the use of "::value" with "std::is_abstract_v" and similar issues
2024-03-02 14:08:03 +01:00
Ivan Savenko 922966dcf8 Renamed JsonNode::meta to more logical modScope. Member is now private 2024-02-26 12:55:49 +02:00
Ivan Savenko 54796c7c56 Rename toJson to toString/toCompactString for consistency 2024-02-26 12:55:49 +02:00
Ivan Savenko c3957c2c2a Moved json files to new directory, split on per-class basis 2024-02-14 13:08:24 +02:00
Ivan Savenko 9ebd194ab1 Merge pull request #3609 from IvanSavenko/single_process
Allow running server as part of client process
2024-02-14 12:06:22 +02:00
Ivan Savenko 4c70abbeb5 Reduced usage of global variables - removed or made const / constexpr 2024-02-12 13:49:45 +02:00
Ivan Savenko a909d7ddde Removed cmake_modules/VCMI_lib macro, use it directly in place 2024-02-11 20:38:24 +02: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
Alexander Wilms 73019c204d Replace redundant types with auto for the lvalues of template factory functions for smart pointers
grep -r --include \*.h --include \*.cpp "= std::" * | grep -v auto | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return" | grep -v double | grep -v si64 | grep -v si32 | grep -v ui32 | grep \< | grep -v float | tr -d '\t' | grep -v assert > redundant_types.txt

import re

with open("redundant_types.txt") as f:
    for line in f:
        line = line.strip()
        path = line.split(":", 1)[0]
        original_code = ":".join(line.split(":")[1:]).strip()

        print()
        print(path)
        print(original_code)
        prefix = "auto "
        if original_code.startswith("static"):
            static = True
        else:
            static = False

        cpp_type = " ".join(original_code.split("=")[0].strip().split(" ")[0:-1])
        print(cpp_type)

        if static:
            new_code = "static auto "+ " ".join(original_code.split(" ")[2:])
        else:
            new_code = "auto "+ " ".join(original_code.split(" ")[1:])
        print(new_code)

        if True:
            with open(path, "r") as f:
                filedata = f.read()

            filedata = filedata.replace(original_code, new_code)

            with open(path, "w") as f:
                f.write(filedata)
2024-01-17 12:50:00 +00:00
Ivan Savenko 52050d0ef1 Fix build 2023-11-15 15:55:19 +02:00
Ivan Savenko ae92bdfb51 Fix Lua and test building 2023-10-23 16:05:38 +03:00
Ivan Savenko b88a8da4e8 Split off some netpack structures into separate files 2023-10-23 13:59:15 +03:00
Ivan Savenko 31cf3442af Update docs 2023-10-22 16:55:19 +03:00
Ivan Savenko a3b2354481 Implemented visit mode "limiter". Fixed h3m variable loading 2023-10-16 00:12:38 +03:00
Ivan Savenko f39fbe5151 Merge pull request #2757 from IvanSavenko/filesystem_refactor
Filesystem refactor - part 1
2023-09-07 10:51:02 +03:00
Ivan Savenko 747e28947a Fix build 2023-09-06 16:03:47 +03:00
Ivan Savenko 823ffa7a07 Always use ResourcePath for referencing images and animations 2023-09-04 18:22:34 +03:00
Ivan Savenko edd029c79c Replace "currentPlayer" from gamestate with "activePlayers"
- Allows multiple active players at once, e.g. simturns
- Cleared up validation of netpacks by server, e.g. always check for
pack sender
2023-08-25 18:56:15 +03:00
Ivan Savenko b61c9a9e35 Fix build 2023-08-25 13:46:42 +03:00
Ivan Savenko 62fddca21e Split massive CModHandler class/file into multiple parts:
- IdentifierStorage is now a separate handler in VLC
- Renamed ModHandler::Incompatibility exception to ModIncompatibility
- Extracted ModScope namespace from ModHandler
- Extracted ModUtilities namespace from ModHandler
- Split CModHandler.cpp on per-class basis
- Replaced some direct members with unique_ptr to reduce header includes
2023-07-30 22:17:47 +03:00
Ivan Savenko 9b5e81929f Fix build 2023-06-20 19:37:27 +03:00
Konstantin e60a4318c3 vcmi: a bunch of forward definitions 2023-05-07 20:37:32 +03:00
Konstantin P 8764765dcf Bonus: complex duration as bitset
Fixes #2125
2023-05-05 21:30:45 +03:00
Konstantin a6de9097be vcmi: rename HeroBonus.h to Bonus.h 2023-05-02 11:20:58 +03:00
Konstantin 29c76fb9bf HeroBonus: split BonusList 2023-05-02 00:54:53 +03:00
Konstantin 4866c2fe5c vcmi: split IBonusBearer 2023-05-02 00:54:53 +03:00
Konstantin b6eb2dc060 vcmi: rename IFactionMember and ICreature 2023-05-02 00:54:53 +03:00
Konstantin 6fa1b2b19f vcmi: move bonuses to its own folder 2023-05-02 00:53:50 +03:00