Fase 1c: rename d'escenes i sistema d'escenes
Tots els tipus, fitxers, namespace, enums i metodes relacionats amb
les escenes passen del catala a l'angles seguint el .clang-tidy:
Fitxers (renames git):
- source/game/escenes/escena_joc.{hpp,cpp} -> game/scenes/game_scene.{hpp,cpp}
- source/game/escenes/escena_titol.{hpp,cpp} -> game/scenes/title_scene.{hpp,cpp}
- source/game/escenes/escena_logo.{hpp,cpp} -> game/scenes/logo_scene.{hpp,cpp}
- source/core/system/context_escenes.hpp -> core/system/scene_context.hpp
- Carpeta game/escenes/ -> game/scenes/
Tipus (CamelCase):
- EscenaJoc -> GameScene
- EscenaTitol -> TitleScene
- EscenaLogo -> LogoScene
- ContextEscenes -> SceneContext
- Escena (enum class) -> SceneType
- Opcio -> Option
- EstatGameOver -> GameOverState
- EstatTitol -> TitleState
- EstatAnimacio -> AnimationState
- ConfigPartida -> MatchConfig
Namespace:
- GestorEscenes -> SceneManager
Valors d'enum SceneType:
- TITOL -> TITLE
- JOC -> GAME
- EIXIR -> EXIT
(LOGO mantingut)
Metodes (camelBack):
- executar -> run
- canviar_escena -> setNextScene
- escena_desti -> nextScene
- opcio (getter) -> option
- consumir_opcio -> consumeOption
- reset_opcio -> resetOption
- set_config_partida -> setMatchConfig
- get_config_partida -> getMatchConfig
Camps privats (lower_case_):
- escena_desti_ -> next_scene_
- opcio_ -> option_
- config_partida_ -> match_config_
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,18 +5,18 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "context_escenes.hpp"
|
||||
#include "scene_context.hpp"
|
||||
#include "core/input/input.hpp"
|
||||
#include "core/input/mouse.hpp"
|
||||
#include "core/rendering/sdl_manager.hpp"
|
||||
|
||||
// Using declarations per simplificar el codi
|
||||
using GestorEscenes::ContextEscenes;
|
||||
using Escena = ContextEscenes::Escena;
|
||||
using SceneManager::SceneContext;
|
||||
using SceneType = SceneContext::SceneType;
|
||||
|
||||
namespace GlobalEvents {
|
||||
|
||||
bool handle(const SDL_Event& event, SDLManager& sdl, ContextEscenes& context) {
|
||||
bool handle(const SDL_Event& event, SDLManager& sdl, SceneContext& context) {
|
||||
// 1. Permitir que Input procese el evento (para hotplug de gamepads)
|
||||
auto event_msg = Input::get()->handleEvent(event);
|
||||
if (!event_msg.empty()) {
|
||||
@@ -25,8 +25,8 @@ bool handle(const SDL_Event& event, SDLManager& sdl, ContextEscenes& context) {
|
||||
|
||||
// 2. Procesar SDL_EVENT_QUIT directamente (no es input de juego)
|
||||
if (event.type == SDL_EVENT_QUIT) {
|
||||
context.canviar_escena(Escena::EIXIR);
|
||||
GestorEscenes::actual = Escena::EIXIR;
|
||||
context.setNextScene(SceneType::EXIT);
|
||||
SceneManager::actual = SceneType::EXIT;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ bool handle(const SDL_Event& event, SDLManager& sdl, ContextEscenes& context) {
|
||||
return true;
|
||||
|
||||
case SDL_SCANCODE_ESCAPE:
|
||||
context.canviar_escena(Escena::EIXIR);
|
||||
GestorEscenes::actual = Escena::EIXIR;
|
||||
context.setNextScene(SceneType::EXIT);
|
||||
SceneManager::actual = SceneType::EXIT;
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user