2dkg/2dkg_zad5/2dgk_zad5/KCollider.h
2022-01-20 08:52:14 +01:00

36 lines
798 B
C++

#pragma once
#include <SDL_rect.h>
#include "KSolid.h"
#include "KVector2d.h"
namespace KapitanGame {
class KCollider
{
public:
KCollider(const KCollider& other);
KCollider(KCollider&& other) noexcept;
KCollider& operator=(const KCollider& other);
KCollider& operator=(KCollider&& other) noexcept;
explicit KCollider(KSolid* parent);
virtual ~KCollider() = default;
virtual bool IsCollision(const KCollider* other) const = 0;
virtual KVector2D GetSeparationVector(const KCollider* other) const = 0;
[[nodiscard]] virtual KVector2D GetSeparationVector(const SDL_FRect& map) const = 0;
[[nodiscard]] virtual float GetWidth() const = 0;
[[nodiscard]] virtual float GetHeight() const = 0;
[[nodiscard]] KSolid* GetParent() const;
private:
KSolid* Parent;
};
}