Skip to content
Snippets Groups Projects
Commit 919d929b authored by David Hermann's avatar David Hermann
Browse files

Merge branch 'dave-commentsv2' into 'main'

Adding and refactoring author comments. Adding and refactoring to Readme.md

See merge request !58
parents dc09feea cdd419da
No related branches found
No related tags found
1 merge request!58Adding and refactoring author comments. Adding and refactoring to Readme.md
Showing
with 159 additions and 80 deletions
# @author David Hermann
cmake_minimum_required(VERSION 3.15)
# Projektname und Sprache
......
......@@ -9,17 +9,20 @@
- Um `clang-tidy` für das ganze Projekt auszuführen und die Warnings in die Datei `clang-tidy-warnings.txt` zu schreiben:
`find src/game -name '*.cpp' -o -name '*.hpp' | xargs clang-tidy -header-filter="src/game/.*" -p build/ 1> clang-tidy-warnings.txt`
## Build-Anleitung
### Linux/MacOS
1. Repository klonen:
```bash
git clone https://github.com/username/project.git
cd project
```
2. Build-Verzeichnis erstellen:
```bash
mkdir build && cd build
```
......@@ -33,12 +36,14 @@
### Windows
1. Repository klonen:
```powershell
git clone https://github.com/username/project.git
cd project
```
2. Build-Verzeichnis erstellen:
```powershell
mkdir build
cd build
......@@ -58,7 +63,6 @@
4. Visual Studio erkennt automatisch das CMake-Projekt
5. Build über "Build All" ausführen
#### Falls Syntax errors
1. Erstelle .vscode/c_cpp_properties.json Datei
......@@ -69,10 +73,7 @@
"configurations": [
{
"name": "Fedora",
"includePath": [
"/usr/include",
"/usr/include/SDL2"
],
"includePath": ["/usr/include", "/usr/include/SDL2"],
"defines": [],
"intelliSenseMode": "linux-gcc-x64",
"compilerPath": "/usr/bin/gcc",
......@@ -94,12 +95,13 @@ cmake .. -DCMAKE_BUILD_TYPE=Debug # Debug-Build
```
## Prerequisites for Leveleditor
- QT 6: ```sudo apt install qt6-base-dev```
- QT 6: `sudo apt install qt6-base-dev`
## Authors
Max Körschen:
- Units.cpp/hpp (Combat and movement)
- Helpmenu.cpp/hpp
- UnitInfoMenu.cpp/hpp
......@@ -108,8 +110,8 @@ Max Körschen:
- level.cpp/hpp (eventhandling for units and buildings, movement, attack etc)
- debugging in CombatEngine.cpp/hpp, Bullets.cpp/hpp
Lorenz Diel:
- Units.cpp/hpp
- UnitInfoMenu.cpp/hpp
- level.cpp/hpp
......@@ -118,6 +120,7 @@ Lorenz Diel:
- CombatEngine.cpp/hpp
David Maul:
- Engine.cpp/hpp
- Scene.hpp
- Spritesheet.cpp/hpp
......@@ -128,6 +131,7 @@ David Maul:
- main.cpp
Frederik Keens:
- main.cpp
- Player.cpp/hpp
- Level.cpp/hpp
......@@ -138,5 +142,20 @@ Frederik Keens:
- Scene.hpp
- Engine.cpp/hpp
David Hermann:
- Projektmanagement (GitLab Issues, Milestones, etc.)
- Projektstruktur (Ordnerhierarchien)
- Refactoring der Architektur für bessere Modularität, Memory Management und Box2d Integration
- Spezifische Arbeit:
- CMakeLists.txt
- CombatEngine.cpp/hpp (refactoring, box2d integration)
- GameManager.cpp/hpp
- Unit.cpp/hpp (refactoring, box2d integration)
- Bullet.cpp/hpp
- Level.cpp/hpp (refactoring, box2d integration)
- PhysicsBody.cpp/hpp (box2d integration)
- PhysicsEngine.cpp/hpp (box2d integration)
- Menu.cpp/hpp (Main Menu UI)
- ContextMenu.cpp/hpp (Context Menu)
- Dimensions.hpp
/**
* CombatEngine.cpp
*
* @author Lorenz Diel
* @author David Hermann
*/
#include "CombatEngine.hpp"
#include "../level/Level.hpp"
......@@ -5,11 +12,6 @@
#include <memory>
#include <unordered_map>
/**
* @authors Lorenz Diel
*/
namespace advanced_wars
{
......
/**
* CombatEngine.hpp
*
* @author Lorenz Diel
* @author David Hermann
*/
#pragma once
#include "../core/Engine.hpp"
#include "../entities/Unit.hpp"
/**
* @authors Lorenz Diel
*/
namespace advanced_wars
{
......
#include "Weapon.hpp"
/**
* @authors Lorenz Diel
* Weapon.cpp
*
* @author Lorenz Diel
*/
#include "Weapon.hpp"
namespace advanced_wars
{
Weapon::Weapon() {}
......
/**
* Weapon.hpp
*
* @author Lorenz Diel
*/
#pragma once
#include <string>
#include <unordered_map>
/**
* @authors Lorenz Diel
*/
namespace advanced_wars
{
......
/**
* Config.cpp
*
* @author Lorenz Diel
*/
#include "Config.hpp"
#include "../entities/Unit.hpp"
......@@ -9,10 +15,6 @@
#include <string>
#include <unordered_map>
/**
* @authors Lorenz Diel
*/
namespace advanced_wars
{
......
/**
* Config.hpp
*
* @author Lorenz Diel
*/
#pragma once
#include <boost/property_tree/ptree.hpp>
......@@ -6,10 +12,6 @@
#include <string>
#include <unordered_map>
/**
* @authors Lorenz Diel
*/
namespace advanced_wars
{
/* ENUMS FOR GLOBAL USE*/
......
/**
* GameManager.cpp
*
* @author David Hermann
*/
#include "GameManager.hpp"
#include <iostream>
#include <memory>
......
/**
* GameManager.hpp
*
* @author David Hermann
*/
#pragma once
#include "../level/Level.hpp"
......
/**
* Effect.cpp
*
* @author David Maul
* @author Frederik Keens
*/
......
/**
* Bullet.cpp
*
* @author David Hermann
*/
#include "Bullet.hpp"
#include "../core/Engine.hpp"
#include "../physics/PhysicsBody.hpp"
......
/**
* Bullet.hpp
*
* @author David Hermann
*/
#pragma once
#include "../core/Engine.hpp"
......
/**
* Unit.cpp
*
* @authors Max Körschen
* @author Max Körschen
* @author Nicolas Will
* @author Frederik Keens
* @author Lorenz Diel
* @author David Hermann
*/
#include "Unit.hpp"
......@@ -65,14 +66,14 @@ Unit::Unit(
Weapon(config.getUnitSecondaryWeapon(m_unitTypeId), secondaryDamage));
}
void Unit::update(float deltaTime)
void Unit::update()
{
if (!m_physicsBody)
{
return;
}
m_physicsBody->update(deltaTime);
m_physicsBody->update();
b2Vec2 pos = m_physicsBody->getPosition();
calcState(static_cast<int>(pos.x), static_cast<int>(pos.y));
......
/**
* Unit.hpp
*
* @authors Max Körschen
* @author Max Körschen
* @author Nicolas Will
* @author Frederik Keens
* @author Lorenz Diel
* @author David Hermann
*/
#pragma once
......@@ -37,7 +38,7 @@ class Unit
~Unit();
/// Aktualisiert die Einheit (Bewegung, Physik, etc.).
void update(float deltaTime);
void update();
/// Bewegt die Einheit zu einer neuen Position.
void moveTo(int posX, int posY);
......
/**
* Level.cpp
*
* @authors Max Körschen
* @author Max Körschen
* @author Nicolas Will
* @author Frederik Keens
* @author Lorenz Diel
* @author David Maul
* @author David Hermann
*/
#include "Level.hpp"
......@@ -381,7 +381,7 @@ void Level::render(Engine& engine)
{
Unit& unitRef = *unit;
m_physicsEngine->step(deltaTime);
unitRef.update(deltaTime);
unitRef.update();
unitRef.render(engine, RENDERING_SCALE);
}
......
/**
* Level.hpp
*
* @authors Max Körschen
* @author Max Körschen
* @author Nicolas Will
* @author Frederik Keens
* @author Lorenz Diel
* @author David Maul
* @author David Hermann
*/
#pragma once
......
/**
* PhysicsBody.cpp
*
* @author David Hermann
*/
#include "PhysicsBody.hpp"
#include "../../util/Dimensions.hpp"
#include <box2d/box2d.h>
......@@ -29,7 +35,7 @@ PhysicsBody::PhysicsBody(
m_fixture = m_body->CreateFixture(&fixtureDef);
}
void PhysicsBody::update(float /*deltaTime*/)
void PhysicsBody::update()
{
if (m_body == nullptr)
{
......
/**
* PhysicsBody.hpp
*
* @author David Hermann
*/
#pragma once
#include "box2d/b2_body.h"
......@@ -17,7 +23,7 @@ class PhysicsBody
PhysicsBody(
b2World* world, int x, int y, float width, float height, float density, float friction,
bool isSensor, BodyType type);
void update(float deltaTime);
void update();
void setTargetPosition(int targetTileX, int targetTileY);
b2Vec2 getPosition() const;
b2Vec2 getVelocity() const;
......
/**
* PhysicsEngine.cpp
*
* @author David Hermann
*/
#include "PhysicsEngine.hpp"
#include "../entities/Bullet.hpp"
#include "../entities/Unit.hpp"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment