ae5cc1cfb4
Tots els tipus d'entitat passen del catala a l'angles seguint el
.clang-tidy del projecte (tipus en CamelCase, metodes en camelBack,
membres en lower_case amb sufix _).
Renames de tipus:
- Entitat -> Entity (core/entities/entity.hpp)
- Nau -> Ship (game/entities/ship.{hpp,cpp})
- Enemic -> Enemy (game/entities/enemy.{hpp,cpp})
- Bala -> Bullet (game/entities/bullet.{hpp,cpp})
- TipusEnemic -> EnemyType
- AnimacioEnemic -> EnemyAnimation
Metodes virtuals (s'aplica a tot el codi, no nomes a entitats):
- actualitzar -> update
- dibuixar -> draw
- inicialitzar -> init
- processar_input -> processInput
- esta_actiu -> isActive
- es_collidable -> isCollidable
- get_collision_radius -> getCollisionRadius
Getters comuns:
- get_centre -> getCenter
- get_angle -> getAngle
- get_brightness -> getBrightness
- get_forma -> getShape
Metodes especifics:
- esta_viva -> isAlive
- esta_tocada -> isHit
- es_invulnerable -> isInvulnerable
- get_velocitat_vector -> getVelocityVector
- set_centre -> setCenter
- marcar_tocada -> markHit
- aplicar_fisica -> applyPhysics
- get_tipus -> getType
Camps privats:
- centre_ -> center_
- velocitat_ -> velocity_
- forma_ -> shape_
- esta_tocada_ -> is_hit_
- tipus_ -> type_
L'import d'audio/input d'AEEA quedara coherent (mateix estil).
Diff net: 30 fitxers, +437/-437 (la majoria es renames simetrics).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
// gestor_puntuacio_flotant.hpp - Gestor de números de puntuació flotants
|
|
// © 2025 Port a C++20 amb SDL3
|
|
|
|
#pragma once
|
|
|
|
#include <SDL3/SDL.h>
|
|
|
|
#include <array>
|
|
|
|
#include "core/defaults.hpp"
|
|
#include "core/graphics/vector_text.hpp"
|
|
#include "core/types.hpp"
|
|
#include "puntuacio_flotant.hpp"
|
|
|
|
namespace Effects {
|
|
|
|
// Gestor de números de puntuació flotants
|
|
// Manté un pool de PuntuacioFlotant i gestiona el seu cicle de vida
|
|
class GestorPuntuacioFlotant {
|
|
public:
|
|
explicit GestorPuntuacioFlotant(SDL_Renderer* renderer);
|
|
|
|
// Crear número flotant
|
|
// - punts: valor numèric (100, 150, 200)
|
|
// - posicio: on apareix (normalment centre d'enemic destruït)
|
|
void crear(int punts, const Vec2& posicio);
|
|
|
|
// Actualitzar tots els números actius
|
|
void update(float delta_time);
|
|
|
|
// Dibuixar tots els números actius
|
|
void draw();
|
|
|
|
// Reiniciar tots (neteja)
|
|
void reiniciar();
|
|
|
|
// Obtenir número actius (debug)
|
|
[[nodiscard]] int get_num_actius() const;
|
|
|
|
private:
|
|
Graphics::VectorText text_; // Sistema de text vectorial
|
|
|
|
// Pool de números flotants (màxim concurrent)
|
|
// Màxim 15 enemics simultanis = màxim 15 números
|
|
static constexpr int MAX_PUNTUACIONS =
|
|
Defaults::FloatingScore::MAX_CONCURRENT;
|
|
std::array<PuntuacioFlotant, MAX_PUNTUACIONS> pool_;
|
|
|
|
// Trobar primer slot inactiu
|
|
PuntuacioFlotant* trobar_slot_lliure();
|
|
};
|
|
|
|
} // namespace Effects
|