Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite the ECS in C++ #142

Merged
merged 29 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
45c54c5
Moved Vec2d to steering.py.
JackAshwell11 Aug 16, 2023
407afc6
Continued transitioning to the component and system design for the ECS.
JackAshwell11 Aug 20, 2023
00d073c
Updated dependencies.
JackAshwell11 Aug 23, 2023
3804bc4
Renamed PhysicsObject to KinematicObject and changed a few related va…
JackAshwell11 Aug 23, 2023
e2b8e10
Updated dependencies.
JackAshwell11 Aug 24, 2023
e69dd48
Improved CMakeLists.txt configuration across all directories. DO_PYTH…
JackAshwell11 Aug 26, 2023
c6b9695
Rearranged primitives.hpp a bit. I would like to have one base file t…
JackAshwell11 Aug 30, 2023
d5981a5
Rearranged directory structure to make it easier to understand.
JackAshwell11 Sep 1, 2023
d9c3828
Renamed Point to Position.
JackAshwell11 Sep 1, 2023
7bf94c1
Moved components.cpp to components.hpp, so they can be inlined as wel…
JackAshwell11 Sep 7, 2023
ef77b84
Implemented inventory.cpp and started on tests for it. Also added the…
JackAshwell11 Sep 9, 2023
f3e8228
Implemented attacks.hpp, attributes.hpp, inventory.hpp and movements.…
JackAshwell11 Sep 12, 2023
fa16c34
Implemented test_attacks.cpp, test_attributes.cpp and test_movements.…
JackAshwell11 Sep 14, 2023
8ecfdd3
Switched all unique_ptrs in Registry to shared_ptr.
JackAshwell11 Sep 15, 2023
1e42430
Started refactoring GameObjectAttributeBase. It's been simplified to …
JackAshwell11 Sep 18, 2023
eb39dc5
Finished implementing effects.hpp. The update() method will accumulat…
JackAshwell11 Sep 21, 2023
1c52efc
Moved hades_extensions to src/ so now C++ code and stub files are sep…
JackAshwell11 Sep 24, 2023
bb504f7
Added clang-format and clang-tidy.
JackAshwell11 Oct 19, 2023
b90bf90
Started refactoring generation/.
JackAshwell11 Oct 24, 2023
e965036
Finished refactoring primitives.hpp and astar.hpp and started refacto…
JackAshwell11 Oct 26, 2023
6ec01e7
Finished the refactor of the generation/ module meaning it is more op…
JackAshwell11 Oct 29, 2023
c0cf2bd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2023
8147be7
Changed add_component to add_components to fix the binding.cpp error.
JackAshwell11 Nov 2, 2023
388fe95
Fixed the remaining clang-tidy errors and warnings.
JackAshwell11 Nov 6, 2023
8d220b4
Updated dependencies.
JackAshwell11 Nov 12, 2023
8c4c135
Started refactoring parts of the registry to be more efficient and wo…
JackAshwell11 Nov 14, 2023
e2eced0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 14, 2023
6529027
Fixed the binding code, so now it takes in Python type objects and co…
JackAshwell11 Nov 20, 2023
c4348cc
Updated dependencies.
JackAshwell11 Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
if: matrix.language == 'cpp'
uses: lukka/run-cmake@v3
with:
cmakeListsTxtPath: "${{ github.workspace }}/hades_extensions/CMakeLists.txt"
cmakeListsTxtPath: "${{ github.workspace }}/src/hades_extensions/CMakeLists.txt"
buildDirectory: "${{ github.workspace }}/build"
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Configure and build CMake
uses: lukka/run-cmake@v3
with:
cmakeListsTxtPath: "${{ github.workspace }}/hades_extensions/CMakeLists.txt"
cmakeListsTxtPath: "${{ github.workspace }}/src/hades_extensions/CMakeLists.txt"
buildDirectory: "${{ github.workspace }}/build"
- name: Run CTest
run: ctest --output-on-failure --test-dir ${{ github.workspace }}/build/test
run: ctest --output-on-failure --test-dir ${{ github.workspace }}/build/tests
183 changes: 48 additions & 135 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,164 +1,77 @@
## Pre-generated Stuff

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.pyd
*.so

# Distribution / packaging
# Build/distribution/packaging
**/build*/
*.egg
*.egg-info/
.Python
build/
.eggs/
.installed.cfg
MANIFEST
__pypackages__/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
share/python-wheels/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
coverage.lcov
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
window.build/
window.dist/

# Flask stuff:
instance/
.webassets-cache
# Byte-compiled/optimized/DLL files
*$py.class
*.py[cod]
__pycache__/

# Scrapy stuff:
.scrapy
# C/C++ extensions
*.pyd
*.so

# Sphinx documentation
# Documentation
/site
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
# Editor files
.idea/
.vscode/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
env/
venv.bak/
venv/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site
# Logs/saves
logs/
pip-delete-this-directory.txt
pip-log.txt
saves/

# mypy
.mypy_cache/
# Type checking
.dmypy.json
dmypy.json

# Pyre type checker
.mypy_cache/
.pyre/

# pytype static type analyzer
.pytype/
dmypy.json

# Cython debug symbols
cython_debug/


## Custom stuff

# Editor files
.idea/
.vscode/

# Log and save files
logs/
saves/

# CMake files
cmake-build-debug/
cmake-build-release/

# Nuitka files
window.build/
window.dist/

# Aseprite project
aseprite/
# Unit test/coverage reports
*.cover
*.py,cover
.cache
.coverage
.coverage.*
.hypothesis/
.nox/
.pytest_cache/
.tox/
cover/
coverage.lcov
coverage.xml
htmlcov/
nosetests.xml
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ default_language_version:

repos:
- repo: "https://github.com/PyCQA/pylint"
rev: v3.0.0a6
rev: v3.0.1
hooks:
- id: pylint
- repo: "https://github.com/bwhmather/ssort"
rev: v0.11.6
hooks:
- id: ssort
- repo: "https://github.com/charliermarsh/ruff-pre-commit"
rev: v0.0.284
rev: v0.1.5
hooks:
- id: ruff
args: ["--fix", "--exit-non-zero-on-fix"]
- repo: "https://github.com/pre-commit/mirrors-mypy"
rev: v1.5.0
rev: v1.7.0
hooks:
- id: mypy
additional_dependencies: ["arcade==3.0.0.dev24", "pytest==7.4.0"]
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-json
- id: check-toml
Expand All @@ -33,6 +33,6 @@ repos:
args: ["--autofix"]
- id: trailing-whitespace
- repo: "https://github.com/psf/black"
rev: 23.7.0
rev: 23.11.0
hooks:
- id: black
Binary file added aseprite/armour_boost_potion.aseprite
Binary file not shown.
Binary file added aseprite/armour_potion.aseprite
Binary file not shown.
Binary file added aseprite/enemy.aseprite
Binary file not shown.
Binary file added aseprite/fire_rate_boost_potion.aseprite
Binary file not shown.
Binary file added aseprite/floor.aseprite
Binary file not shown.
Binary file added aseprite/health_boost_potion.aseprite
Binary file not shown.
Binary file added aseprite/health_potion.aseprite
Binary file not shown.
Binary file added aseprite/player.aseprite
Binary file not shown.
Binary file added aseprite/shop.aseprite
Binary file not shown.
Binary file added aseprite/speed_boost_potion.aseprite
Binary file not shown.
Binary file added aseprite/wall.aseprite
Binary file not shown.
6 changes: 4 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manages various building/compiling operations on the game."""

from __future__ import annotations

# Builtin
Expand Down Expand Up @@ -47,13 +48,14 @@ def build_extension(self: CMakeBuild, ext: Extension) -> None:
build_temp.mkdir(parents=True, exist_ok=True)

# Compile and build the CMake extension
# TODO: Add CMake presets here
subprocess.run(
" ".join(
[
"cmake",
str(current_dir.joinpath(ext.sources[0])),
"-DDO_PYTHON=true",
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE={build_dir}",
"-DDO_TESTS=OFF",
],
),
cwd=build_temp,
Expand Down Expand Up @@ -103,7 +105,7 @@ def cpp() -> None:
result_path = Path(__file__).parent.joinpath(
setup(
name="hades_extensions",
ext_modules=[Extension("hades_extensions", ["hades_extensions"])],
ext_modules=[Extension("hades_extensions", ["src/hades_extensions"])],
script_args=["bdist_wheel"],
cmdclass={"build_ext": CMakeBuild},
).dist_files[0][2],
Expand Down
28 changes: 0 additions & 28 deletions hades_extensions/CMakeLists.txt

This file was deleted.

Loading
Loading