//
// Created by sebastian on 02.08.26.
//

#ifndef COLORRACE_BOARDLAYOUT_H
#define COLORRACE_BOARDLAYOUT_H
#include <unordered_map>

#include "LudoTypes.h"
#include "glm/vec3.hpp"
#include "loader/models/Model.h"


namespace ludo {
    class BoardLayout {
    public:
       explicit BoardLayout(std::shared_ptr<engine::Model> boardModel): m_boardModel(std::move(boardModel)) {
           for (const auto& section : m_boardModel->getSections()) {
               m_positions[section.name] = section.centroid;
           }
       }

        [[nodiscard]] glm::vec3 getWorldPosition(ludo::PlayerColor color, ludo::PieceState state, int position) const;
    private:
        std::shared_ptr<engine::Model> m_boardModel;
        std::unordered_map<std::string, glm::vec3> m_positions;
    };
}


#endif //COLORRACE_BOARDLAYOUT_H
