words

package
v0.0.0-...-53be003 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameData

type GameData struct {
	Words   []*Word
	Sylabes map[int]*Sylabe
}

func (*GameData) GetRandomWord

func (data *GameData) GetRandomWord(exclude []*Word) (*Word, error)

func (*GameData) GetUnusedSylabes

func (data *GameData) GetUnusedSylabes(amount int, word *Word) ([]*Sylabe, error)

type GameDataAccessor

type GameDataAccessor interface {
	GetRandomWord(exclude []*Word) (*Word, error)
	GetUnusedSylabes(amount int, word *Word) ([]*Sylabe, error)
}

type Loader

type Loader interface {
	Load() (*GameData, error)
}

type SqliteLoader

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

func NewSqliteLoader

func NewSqliteLoader(dbPath string) *SqliteLoader

func (*SqliteLoader) Load

func (loader *SqliteLoader) Load() (GameDataAccessor, error)

type Sylabe

type Sylabe struct {
	Sylabe    string
	AudioFile string
}

type Word

type Word struct {
	Word      string
	Sylabes   []*Sylabe
	AudioFile string
}

Jump to

Keyboard shortcuts

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