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

24 lines
601 B
C++

#pragma once
#include "Constants.h"
#include "KSolid.h"
#include "KRect.h"
namespace KapitanGame
{
class KSolidTile final :
public KSolid
{
public:
KSolidTile(const KVector2D& position, const KTexture& texture, SDL_Rect* tileClip, const SDL_RendererFlip flip = SDL_FLIP_NONE)
: KSolid(position, texture, tileClip, flip),
Collider(this, tileClip != nullptr ? Constants::TILE_WIDTH * 1.f : texture.GetWidth() * 1.f, tileClip != nullptr ? Constants::TILE_HEIGHT * 1.f : texture.GetHeight() * 1.f)
{
}
const KCollider* GetCollider() const override;
private:
KRect Collider;
};
}