fix(shape_loader): corregir inconsistencias de naming y static
- Renombrar getCacheSize() → get_cache_size() (match con .hpp) - Renombrar resolvePath() → resolve_path() (match con .hpp) - Cambiar base_path → base_path_ (match con .hpp) - Eliminar 'static' de definiciones fuera de clase (error de C++)
This commit is contained in:
@@ -11,9 +11,9 @@ namespace Graphics {
|
||||
|
||||
// Inicialització de variables estàtiques
|
||||
std::unordered_map<std::string, std::shared_ptr<Shape>> ShapeLoader::cache_;
|
||||
std::string ShapeLoader::base_path = "data/shapes/";
|
||||
std::string ShapeLoader::base_path_ = "data/shapes/";
|
||||
|
||||
static std::shared_ptr<Shape> ShapeLoader::load(const std::string& filename) {
|
||||
std::shared_ptr<Shape> ShapeLoader::load(const std::string& filename) {
|
||||
// Check cache first
|
||||
auto it = cache_.find(filename);
|
||||
if (it != cache_.end()) {
|
||||
@@ -66,9 +66,9 @@ void ShapeLoader::clear_cache() {
|
||||
cache_.clear();
|
||||
}
|
||||
|
||||
size_t ShapeLoader::getCacheSize() { return cache_.size(); }
|
||||
size_t ShapeLoader::get_cache_size() { return cache_.size(); }
|
||||
|
||||
static std::string ShapeLoader::resolvePath(const std::string& filename) {
|
||||
std::string ShapeLoader::resolve_path(const std::string& filename) {
|
||||
// Si és un path absolut (comença amb '/'), usar-lo directament
|
||||
if (!filename.empty() && filename[0] == '/') {
|
||||
return filename;
|
||||
|
||||
Reference in New Issue
Block a user