- Introduced `Paddle` class for player controls in the SFML project. - Added `main.cpp` to demonstrate basic paddle movement and rendering. - Created reusable templates (`templates.h`) and inline class (`inlines.h`) in the `misc` module. - Defined `structs`, `enums`, `unions` in `misc/structs_enums_unions.h`. - Updated CMake configuration for the `sfml` and `misc` modules. - Included new assets for backgrounds, characters, enemies, and tiles.
28 lines
382 B
C++
28 lines
382 B
C++
//
|
|
// Created by David Hackbarth on 27.02.26.
|
|
//
|
|
|
|
#ifndef MISC_TEMPLATES_H
|
|
#define MISC_TEMPLATES_H
|
|
|
|
template<class T>
|
|
void safeDelete(T*& pObj)
|
|
{
|
|
if (pObj != nullptr)
|
|
{
|
|
delete pObj;
|
|
pObj = nullptr;
|
|
}
|
|
}
|
|
|
|
template<typename T>
|
|
class Node
|
|
{
|
|
public:
|
|
T data;
|
|
Node* next;
|
|
|
|
Node(T value) : data(value), next(nullptr) {}
|
|
};
|
|
|
|
#endif //MISC_TEMPLATES_H
|