Documentation ¶
Index ¶
- Variables
- type Player
- func (p *Player) Activate() error
- func (p *Player) Apply(e core.Event, new bool)
- func (p *Player) AssignTeam(t core.Group) error
- func (p *Player) Deactivate() error
- func (p Player) Events() []core.Event
- func (p *Player) GetEntity() core.Person
- func (p *Player) GetID() uuid.UUID
- func (p *Player) GetName() string
- func (p *Player) GetTeams() (teams []core.Group)
- func (p *Player) IsActivated() bool
- func (p *Player) UnassignTeam(t core.Group) error
- func (p Player) Version() int
- type PlayerActivated
- type PlayerCreated
- type PlayerDeactivated
- type PlayerRepository
- type TeamAssignedToPlayer
- type TeamUnassignedFromPlayer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPerson = errors.New("model: player has to be a valid person") ErrPlayerUpdateFailed = errors.New("model: player update failed") )
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player is a aggregate that combines all entities needed to represent a player.
func NewPlayerFromEvents ¶
NewFromEvents is a helper method that creates a new player from a series of events.
func (*Player) AssignTeam ¶
AssignTeam assigns team to player.
func (*Player) IsActivated ¶
IsActivated returns whether the player is activated.
func (*Player) UnassignTeam ¶
UnassignTeam unassigns team from player.
type PlayerActivated ¶
PlayerActivated event.
func (PlayerActivated) EventName ¶
func (e PlayerActivated) EventName() string
type PlayerCreated ¶
PlayerCreated event.
func (PlayerCreated) EventName ¶
func (e PlayerCreated) EventName() string
type PlayerDeactivated ¶
PlayerDeactivated event.
func (PlayerDeactivated) EventName ¶
func (e PlayerDeactivated) EventName() string
type PlayerRepository ¶
type PlayerRepository interface { Get(core.Person) (*Player, error) GetTeams(core.Person) ([]core.Group, error) Add(*Player) error Update(*Player) error }
PlayerRepository defines the interface for the player repository.
Click to show internal directories.
Click to hide internal directories.