Skip to content

Commit 1b15118

Browse files
author
fxrmi
committed
Revert Merge
1 parent f55f8dc commit 1b15118

File tree

124 files changed

+1343
-5995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+1343
-5995
lines changed

Diff for: .clang-tidy

-19
This file was deleted.

Diff for: .github/workflows/builds.yml

+5-38
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,9 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
static-checks:
14-
name: Code style, file formatting, and docs
15-
runs-on: ubuntu-24.04
16-
steps:
17-
- name: Checkout project
18-
uses: actions/[email protected]
19-
with:
20-
fetch-depth: 2
21-
22-
- name: Install APT dependencies
23-
uses: awalsh128/cache-apt-pkgs-action@latest
24-
with:
25-
packages: libxml2-utils
26-
27-
- name: Get changed files
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
run: |
31-
if [ "${{ github.event_name }}" == "pull_request" ]; then
32-
files=$(git diff-tree --no-commit-id --name-only -r HEAD^1..HEAD 2> /dev/null || true)
33-
elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then
34-
files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true)
35-
fi
36-
echo "$files" >> changed.txt
37-
cat changed.txt
38-
files=$(echo "$files" | xargs -I {} sh -c 'echo "\"./{}\""' | tr '\n' ' ')
39-
echo "CHANGED_FILES=$files" >> $GITHUB_ENV
40-
- name: Style checks via pre-commit
41-
uses: pre-commit/[email protected]
42-
with:
43-
extra_args: --files ${{ env.CHANGED_FILES }}
44-
4513
build:
4614
runs-on: ${{matrix.os}}
4715
name: ${{matrix.name}}
48-
needs: static-checks
4916
permissions: write-all
5017
strategy:
5118
fail-fast: false
@@ -92,7 +59,7 @@ jobs:
9259

9360
steps:
9461
- name: Checkout project
95-
uses: actions/checkout@v4
62+
uses: actions/checkout@v4.1.1
9663
with:
9764
submodules: recursive
9865

@@ -104,7 +71,7 @@ jobs:
10471
continue-on-error: true
10572

10673
- name: Set up Python
107-
uses: actions/setup-python@v5
74+
uses: actions/setup-python@v5.0.0
10875
with:
10976
python-version: "3.x"
11077

@@ -138,14 +105,14 @@ jobs:
138105
Remove-Item bin/* -Include *.exp,*.pdb -Force
139106
140107
- name: Upload library artifact
141-
uses: actions/upload-artifact@v4
108+
uses: actions/upload-artifact@v4.3.0
142109
with:
143110
name: ${{ github.event.repository.name }}-${{ matrix.identifier }}-library
144111
path: |
145112
${{ github.workspace }}/bin/libopenvic-simulation.*
146113
147114
- name: Upload executable artifact
148-
uses: actions/upload-artifact@v4
115+
uses: actions/upload-artifact@v4.3.0
149116
with:
150117
name: ${{ github.event.repository.name }}-${{ matrix.identifier }}-executable
151118
path: |
@@ -175,7 +142,7 @@ jobs:
175142
name: 📚 Merge Library Files
176143
steps:
177144
- name: Merge Artifacts
178-
uses: actions/upload-artifact/merge@v4
145+
uses: actions/upload-artifact/merge@v4.3.0
179146
with:
180147
delete-merged: true
181148
name: ${{ github.event.repository.name }}-library

Diff for: .gitmodules

-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,3 @@
1717
path = tests/deps/snitch
1818
url = https://github.com/snitch-org/snitch
1919
ignore = dirty
20-
[submodule "deps/function2"]
21-
path = deps/function2
22-
url = https://github.com/Naios/function2
23-
[submodule "deps/std_function/func"]
24-
path = deps/std_function/func
25-
url = https://github.com/skarupke/std_function

Diff for: .pre-commit-config.yaml

-51
This file was deleted.

Diff for: deps/SCsub

-16
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,6 @@ def build_colony(env):
3131
env.Append(CPPPATH=env.colony["INCPATH"])
3232
env.exposed_includes += env.colony["INCPATH"]
3333

34-
def build_function2(env):
35-
include_path = "function2/include"
36-
env.function2 = {}
37-
env.function2["INCPATH"] = [env.Dir(include_path)]
38-
env.Append(CPPPATH=env.function2["INCPATH"])
39-
env.exposed_includes += env.function2["INCPATH"]
40-
41-
def build_std_function(env):
42-
include_path = "std_function"
43-
env.std_function = {}
44-
env.std_function["INCPATH"] = [env.Dir(include_path)]
45-
env.Append(CPPPATH=env.std_function["INCPATH"])
46-
env.exposed_includes += env.std_function["INCPATH"]
47-
4834
def link_tbb(env):
4935
import sys
5036
if not env.get("is_msvc", False) and not env.get("use_mingw", False) and sys.platform != "darwin":
@@ -54,6 +40,4 @@ build_openvic_dataloader(env)
5440
build_lexy_vdf(env)
5541
build_ordered_map(env)
5642
build_colony(env)
57-
build_function2(env)
58-
build_std_function(env)
5943
link_tbb(env)

Diff for: deps/function2

-1
This file was deleted.

Diff for: deps/lexy-vdf

Submodule lexy-vdf updated 1 file

Diff for: deps/std_function/func

-1
This file was deleted.

Diff for: pyproject.toml

-36
This file was deleted.

Diff for: src/headless/main.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static bool run_headless(Dataloader::path_vector_t const& roots, bool run_tests)
6060

6161
GameManager game_manager { []() {
6262
Logger::info("State updated");
63-
} };
63+
}, nullptr };
6464

6565
Logger::info("===== Loading definitions... =====");
6666
ret &= game_manager.set_roots(roots);
@@ -129,16 +129,6 @@ static bool run_headless(Dataloader::path_vector_t const& roots, bool run_tests)
129129
ret = false;
130130
}
131131

132-
if (ret) {
133-
size_t ticks_passed = 0;
134-
auto start_time = std::chrono::high_resolution_clock::now();
135-
while (ticks_passed++ < 10) {
136-
game_manager.get_instance_manager()->force_tick_and_update();
137-
}
138-
auto end_time = std::chrono::high_resolution_clock::now();
139-
Logger::info("Ran ", --ticks_passed, " ticks in ", end_time - start_time);
140-
}
141-
142132
return ret;
143133
}
144134

Diff for: src/openvic-simulation/GameManager.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
using namespace OpenVic;
44

55
GameManager::GameManager(
6-
InstanceManager::gamestate_updated_func_t new_gamestate_updated_callback
6+
InstanceManager::gamestate_updated_func_t new_gamestate_updated_callback,
7+
SimulationClock::state_changed_function_t new_clock_state_changed_callback
78
) : gamestate_updated_callback {
89
new_gamestate_updated_callback ? std::move(new_gamestate_updated_callback) : []() {}
10+
}, clock_state_changed_callback {
11+
new_clock_state_changed_callback ? std::move(new_clock_state_changed_callback) : []() {}
912
}, definitions_loaded { false } {}
1013

1114
bool GameManager::set_roots(Dataloader::path_vector_t const& roots) {
@@ -49,7 +52,8 @@ bool GameManager::setup_instance(Bookmark const* bookmark) {
4952
instance_manager.emplace(
5053
game_rules_manager,
5154
definition_manager,
52-
gamestate_updated_callback
55+
gamestate_updated_callback,
56+
clock_state_changed_callback
5357
);
5458

5559
bool ret = instance_manager->setup();

Diff for: src/openvic-simulation/GameManager.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ namespace OpenVic {
1616
std::optional<InstanceManager> instance_manager;
1717

1818
InstanceManager::gamestate_updated_func_t gamestate_updated_callback;
19+
SimulationClock::state_changed_function_t clock_state_changed_callback;
1920
bool PROPERTY_CUSTOM_PREFIX(definitions_loaded, are);
2021

2122
public:
2223
GameManager(
23-
InstanceManager::gamestate_updated_func_t new_gamestate_updated_callback
24+
InstanceManager::gamestate_updated_func_t new_gamestate_updated_callback,
25+
SimulationClock::state_changed_function_t new_clock_state_changed_callback
2426
);
2527

2628
inline constexpr InstanceManager* get_instance_manager() {

0 commit comments

Comments
 (0)