vo

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package vo define estructuras de datos a utilizar para la comunicación con la base de datos y los clientes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElementoListaPartidas

type ElementoListaPartidas struct {
	IdPartida          int
	EsPublica          bool
	NumeroJugadores    int
	MaxNumeroJugadores int
	AmigosPresentes    []string
	NumAmigosPresentes int
}

type ElementoListaUsuarios

type ElementoListaUsuarios struct {
	Email              string
	NombreUsuario      string
	Biografia          string
	PartidasGanadas    int
	PartidasTotales    int
	Puntos             int
	ID_dado            int
	ID_avatar          int
	EsAmigo            bool
	SolicitudRecibida  bool
	SolicitudPendiente bool
}

type ElementoListaUsuariosSimilares added in v0.4.0

type ElementoListaUsuariosSimilares struct {
	Nombre             string
	EsAmigo            bool
	SolicitudRecibida  bool
	SolicitudPendiente bool
}

type ElementoRankingUsuarios added in v0.5.0

type ElementoRankingUsuarios struct {
	NombreUsuario   string
	PartidasGanadas int
	PartidasTotales int
}

type EstadoLobby

type EstadoLobby struct {
	EnCurso          bool
	EsPublico        bool
	Jugadores        int
	MaxJugadores     int
	NombresJugadores []string
}

type ItemTienda added in v0.5.0

type ItemTienda struct {
	Id          int
	Nombre      string
	Descripcion string
	Precio      int
	Tipo        string
	Imagen      []byte // Blob
}

type Mensaje

type Mensaje struct {
}

type Partida

type Partida struct {
	IdPartida          int
	EsPublica          bool
	PasswordHash       string
	EnCurso            bool
	MaxNumeroJugadores int

	// TODO: eliminar campo Mensajes de partida de dao y modelo de datos
	Mensajes []Mensaje
	Estado   logica_juego.EstadoPartida
}

func CrearPartida

func CrearPartida(esPublica bool, passwordHash string, maxNumeroJugadores int) *Partida

CrearPartida devuelve una partida sin estado ni ID asignado.

func (*Partida) IniciarPartida

func (p *Partida) IniciarPartida(jugadores []string)

IniciarPartida marca una partida como iniciada y crea un estado para ella con los jugadores indicados, iniciando la primera fase (asignación de territorios) tras ello.

type ResumenEstadoJugador added in v0.6.4

type ResumenEstadoJugador struct {
	NumCartas int
	Cartas    []logica_juego.Carta
	Tropas    int
	Expulsado bool
	Eliminado bool
}

type ResumenPartida added in v0.6.4

type ResumenPartida struct {
	Jugadores                  []string
	TurnoJugador               string
	Fase                       logica_juego.Fase
	Terminada                  bool
	EstadosJugadores           map[string]ResumenEstadoJugador
	Mapa                       map[logica_juego.NumRegion]logica_juego.EstadoRegion
	OcupacionPendiente         bool
	TerritorioOcupacionOrigen  logica_juego.NumRegion
	TerritorioOcupacionDestino logica_juego.NumRegion
}

type Usuario

type Usuario struct {
	Email           string
	NombreUsuario   string
	PasswordHash    string
	Biografia       string
	CookieSesion    http.Cookie
	Puntos          int
	PartidasGanadas int
	PartidasTotales int
	ID_dado         int
	ID_avatar       int
}

Usuario es un objeto de usuario equivalente al del modelo de base de datos.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL