#pragma once

#include <frostbite2D/types/type_math.h>

namespace ns_game {

enum class Team {
  Player,
  Enemy
};

struct Hitbox {
  frostbite2D::Rect bounds;
  Team ownerTeam = Team::Player;
  int damage = 1;
  float activeSeconds = 0.0f;
};

struct Hurtbox {
  frostbite2D::Rect bounds;
  Team ownerTeam = Team::Enemy;
};

inline bool CanHit(const Hitbox& hitbox, const Hurtbox& hurtbox) {
  return hitbox.ownerTeam != hurtbox.ownerTeam &&
         hitbox.bounds.intersects(hurtbox.bounds);
}

} // namespace ns_game
