player

package
v0.0.0-...-f17d466 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Player

type Player struct {
	Name string
	X    float64
	Y    float64
	// contains filtered or unexported fields
}

type PlayerRepository

type PlayerRepository interface {
	GetByID(id int) (*Player, error)
	GetAll() []Player
	Create(player Player) (*Player, error)
	Update(player Player) error
	Delete(id int) error
}

func PlayerRepositoryInMemoryImpl

func PlayerRepositoryInMemoryImpl() PlayerRepository

type PlayerRepositoryInMemory

type PlayerRepositoryInMemory struct {
	// contains filtered or unexported fields
}

func (*PlayerRepositoryInMemory) Create

func (playerRepository *PlayerRepositoryInMemory) Create(player Player) (*Player, error)

func (*PlayerRepositoryInMemory) Delete

func (playerRepository *PlayerRepositoryInMemory) Delete(id int) error

func (*PlayerRepositoryInMemory) GetAll

func (playerRepository *PlayerRepositoryInMemory) GetAll() []Player

func (*PlayerRepositoryInMemory) GetByID

func (playerRepository *PlayerRepositoryInMemory) GetByID(id int) (*Player, error)

func (*PlayerRepositoryInMemory) Update

func (playerRepository *PlayerRepositoryInMemory) Update(player Player) error

type PlayerService

type PlayerService struct {
	// contains filtered or unexported fields
}

func PlayerServiceImpl

func PlayerServiceImpl(repo PlayerRepository) *PlayerService

func (*PlayerService) CreatePlayer

func (service *PlayerService) CreatePlayer(name string) (*Player, error)

func (*PlayerService) GetPlayer

func (service *PlayerService) GetPlayer(id int) (*Player, error)

Jump to

Keyboard shortcuts

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