#pragma once

#include <frostbite2D/types/type_math.h>
#include <vector>

namespace frostbite2D::gameMath {

int32 RoundWorldCoordinate(float value);
Vec2 MakeIntegerWorldPoint(int x, int y);
Vec3 MakeIntegerWorldPosition(int x, int y, int z);

bool IsPointOnSegment(const Vec2& point, const Vec2& start, const Vec2& end);
bool IsPointInPolygon(const std::vector<Vec2>& polygon, const Vec2& point);
bool IsPointMovable(const std::vector<Vec2>& polygon, int x, int y);

std::vector<Vec2> BuildRectPolygon(const Rect& rect);
std::vector<Rect> BuildPolygonFillRects(const std::vector<Vec2>& polygon);

} // namespace frostbite2D::gameMath
