UML

parent 6bbe86cf
Showing with 278 additions and 0 deletions
@startuml
package "Utils" {
class Fuente {
Permite cargar la fuente de manera lazy y con RAII
..
- camino : string
- tamano_pt : int
- fuente : TTF_Font *
--
+ Fuente(camino : string, tamano_pt : int)
+ operator*() : TTF_Font *
+ ~Fuente()
}
class Hitbox {
+ xMaximo : int
+ xMinimo : int
+ zMaximo : int
+ zMinimo : int
+ colisiona(x, z) : bool
}
class Sprite {
- camino : string
- texture : SDL_Texture *
- get_textura(SDL_Renderer *) : SDL_Texture *
--
+ Sprite(camino : string)
+ Sprite(Sprite)
+ renderizar(SDL_Renderer *)
+ getCamino() : string
}
class Sonido {
- archivo : Mix_Music *
- tocada : bool
- acaba : bool
--
+ Sonido(ruta : string)
+ play()
+ pausar()
+ tocada() : bool
+ acabado() : bool
}
class Texto {
- texto : string
- fg : SDL_Color
- surface : SDL_Surface *
- texture : SDL_Texture *
--
+ renderizar(SDL_Renderer *)
}
Texto --* "1" Fuente
class Video {
{static} + play_video(nombre : string, idioma : string)
}
}
package "GestorPantallas" {
class Handle {
- idPantalla : int
- tamx : int
- tamy : int
- Handle(GestorPantallas &)
--
+ reemplazamePor(Pantalla)
+ addPantalla(Pantalla)
+ removeme()
+ removeAll()
+ getTamX() : int
+ getTamY() : int
+ pantallaMinimizada() : bool
}
class GestorPantallas {
- renderer : SLD_Renderer *
- window : SDL_Window *
- inicializarSDL() : bool
--
+ GestorPantallas(pantallaInicial : Pantalla)
+ mainLoop() : void
}
interface Pantalla {
+ manejarEntrada(Handle)
+ renderizar(SDL_Renderer *)
+ transparente() : bool
+ init()
}
GestorPantallas --* "1..*" Pantalla : "pantallas"
Handle --> GestorPantallas
}
class colPantallas <<Singleton>> {
+operator[](int) : Pantalla
..
+getPantallaPrincipal() : PantallaPrincipal
+getPantallaPrincipal2() : PantallaPrincipal2
+getPantallaFecha() : PantallaFecha
+getPantallaCama() : PantallaCama
+getPantallaTutorial() : PantallaTutorial
+getPantallaGracias() : PantallaGracias
}
colPantallas --o Pantalla
class Historia <<Singleton>> {
- limpiarEstado()
- siguienteEstado(Secuncia)
--
+ getEstadoActual() : Secuencia
+ pasarDeEstadoA(estadoActual : Secuencia, siguienteEstado : Secuencia)
+ soltarCartera : bool
}
enum Secuencia {
PreInicio
Inicio
CalendarioVisto
CalendiarioQuitado
PuzlePantallaResuleto
CajaVista
CajonAbierto
CajaAbierta
LlaveVista
CarteraRecuperada
ImanSacado
LlaveConseguida
}
Historia --* "1" Secuencia : "estadoActual"
package "Personaje" {
enum Facing {
Frente = 0
Derecha = 1
Izquierda = 2
Fondo = 3
}
class Personaje <<Singleton>> {
- momento_ultimo_movimiento : Instant
- x : int
- profundidades : int
- paso : bool
- primerPaso : bool
--
+ move(direcion : Facing)
+ renderizar(SDL_Renderer *)
+ renderizarInventario(SDL_Renderer *)
+ comprobarColision(Hitbox)
+ comprobarColisionPasiva(Hitbox) : bool
+ unsetInventario(pos : unsigned)
+ numObjetos() : unsigned
}
Personaje --* "16" Sprite
Personaje --* "1" Facing
Personaje --* Utils
}
package "Mano" {
class Mano {
- x : int
- profundidades : int
--
+ move(direcion : Facing)
+ renderizar(SDL_Renderer *)
+ renderizarCola(SDL_Renderer *)
+ comprobarColision(Hitbox)
+ comprobarColisionPasiva(Hitbox) : bool
+ reiniciar()
}
class Cola {
+ x : int
+ profundidades : int
}
Mano --* "4" Sprite : "manos"
Mano --* "4" Sprite : "brazos"
Mano --* "0..*" Cola : "cola"
Mano --* "1" Facing : "estado"
Cola --* "1" Sprite : "sprite"
}
class Objeto {
- x : int
- y : int
- w : int
- h : int
- funcionInteracion : bool fn(Objeto*, Handle)
--
+ renderizar(SDL_Renderer *)
+ interactuar(Handle) : bool
+ colisionarObjeto(Hitbox) : bool
}
Objeto --* "1" Sprite : "sprite"
Objeto --* "1" Hitbox : "hitbox"
package "Pantallas" {
class PantallaCama {
- carteraTocada : bool
- movimiento : bool
--
+ comprobarColisionesPasivas(Handle)
+ comprobarColisionesActivas()
}
PantallaCama ..|> Pantalla
PantallaCama --* "1" Mano.Mano
class PantallaFecha {
- combinacionActual : int[4]
- combinacionBuena : int[4]
- AgapitoTieneCarne : bool
}
PantallaFecha ..|> Pantalla
class PantallaGracias {}
PantallaGracias ..|> Pantalla
class PantallaInicio {
- iniciar(Handle)
}
PantallaInicio ..|> Pantalla
class PantallaMundo {
- siguientePantalla : size_t
- ojoAbierto : bool
- indiceColision : int
- comprobarColisionesPasivas()
- comprobarColisionesActivas()
- comprobarColisionSiguientePantalla(Handle)
- hooks : Hook[]
--
# PantallaMundo(posInicioPersonaje : int[2])
+ borrarElementos()
+ anadirObjeto(Objeto)
+ anadirHook(Hook)
+ setOjoAbierto(bool)
}
PantallaMundo ..|> Pantalla
class PantallaPrincipal {}
class PantallaPrincipal2 {}
PantallaPrincipal --|> PantallaMundo
PantallaPrincipal2 --|> PantallaMundo
class PantallaTutorial {}
PantallaTutorial ..|> Pantalla
}
Pantallas --> Utils
Personaje --* "3" Objeto
@enduml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment