league

package
v0.0.0-...-838c4ee Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllTeams = []Team{
	Team{"Houston", "Longhorns", "HOU", league, PlayerGroup{[]Player{}}},
	Team{"Las Vegas", "Rattlers", "LVR", league, PlayerGroup{[]Player{}}},
	Team{"Seattle", "Needlers", "SEA", league, PlayerGroup{[]Player{}}},
	Team{"Washington", "Washers", "WAS", league, PlayerGroup{[]Player{}}},
}

TODO: initialize this list in the driver function TODO: change to local list to support multiple leagues global list of teams in the league

Functions

func PopulateDatabase

func PopulateDatabase(db *sql.DB, src string) error

Types

type Attribute

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

type DraftPool

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

type FreeAgency

type FreeAgency struct {
	PlayerGroup
}

type League

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

func (League) AddTeam

func (l League) AddTeam(team Team)

type Player

type Player struct {
	FirstName string
	LastName  string
	Pos       string
	Attr      map[string]int
}

TODO: add number and validation

func NewPlayer

func NewPlayer(firstName string, lastName string, pos string) (*Player, error)

func (Player) Compare

func (p Player) Compare(player Player) bool

TODO: Add IDs to make this easier

func (Player) UpdateAttr

func (p Player) UpdateAttr(attrName string, attrVal int) error

func (Player) UpdateAttrs

func (p Player) UpdateAttrs(attrs []Attribute) error

type PlayerGroup

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

func (PlayerGroup) AddPlayer

func (pg PlayerGroup) AddPlayer(player Player)

func (PlayerGroup) DropPlayer

func (pg PlayerGroup) DropPlayer(player Player) error

TODO: Find and drop player from group. If not found, return an error

func (PlayerGroup) MovePlayer

func (pg PlayerGroup) MovePlayer(player Player, recGroup PlayerGroup) error

type Team

type Team struct {
	PlayerGroup
	// contains filtered or unexported fields
}

IDs

func NewTeam

func NewTeam(city string, name string, abbr string) (*Team, error)

func (Team) String

func (t Team) String() string

string formatting for a team

Jump to

Keyboard shortcuts

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