Documentation ¶
Index ¶
- func ImagePathToURL(cardType, imageName string) string
- type ArchivesClient
- type CommandCard
- type Dice
- type InMemoryClient
- func (c *InMemoryClient) CommandCards(field, term string) ([]CommandCard, error)
- func (c *InMemoryClient) ExtCommandCard(name string) (*legiondata.CommandCard, error)
- func (c *InMemoryClient) ExtUnit(name, rank string) (*legiondata.Unit, error)
- func (c *InMemoryClient) ExtUpgrade(name string) (*legiondata.Upgrade, error)
- func (c *InMemoryClient) FetchAllData()
- func (c *InMemoryClient) GetKeywords(nameIn string) ([]Keyword, error)
- func (c *InMemoryClient) UnitCards(field, term string) ([]Unit, error)
- func (c *InMemoryClient) UpgradeCards(field, term string) ([]Upgrade, error)
- type Keyword
- type Range
- type Surge
- type Unit
- type Upgrade
- type Weapon
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImagePathToURL ¶ added in v1.3.0
Types ¶
type ArchivesClient ¶
type ArchivesClient struct {
// contains filtered or unexported fields
}
ArchivesClient handles communication to the Archives
func NewArchivesClient ¶
func NewArchivesClient(url string) ArchivesClient
NewArchivesClient creates and returns a new ArchivesClient
func (*ArchivesClient) GetCommandCards ¶
func (client *ArchivesClient) GetCommandCards(field, term string) []CommandCard
GetCommandCards get the command cards from the archives
func (*ArchivesClient) GetKeywords ¶
func (client *ArchivesClient) GetKeywords(field, term string) []Keyword
GetKeywords gets the keywords from the archives
func (*ArchivesClient) GetUnits ¶
func (client *ArchivesClient) GetUnits(field, term string) []Unit
GetUnits gets the unit cards from the archives
func (*ArchivesClient) GetUpgrades ¶
func (client *ArchivesClient) GetUpgrades(field, term string) []Upgrade
GetUpgrades get the upgrade cards from the archives
type CommandCard ¶
type CommandCard struct { Name string `json:"name"` Image string `json:"image"` Requirements []string `json:"requirements"` Faction string `json:"faction"` Keywords []string `json:"keywords"` Pips int `json:"pips"` Commander string `json:"commander"` Orders string `json:"orders"` Weapon *Weapon `json:"weapon,omitempty"` Text string `json:"text,omitempty"` }
func CardToCommand ¶ added in v1.3.0
func CardToCommand(card *legionhq.Card, extCard *legiondata.CommandCard) CommandCard
type Dice ¶
type InMemoryClient ¶ added in v1.3.0
type InMemoryClient struct {
// contains filtered or unexported fields
}
func (*InMemoryClient) CommandCards ¶ added in v1.3.0
func (c *InMemoryClient) CommandCards(field, term string) ([]CommandCard, error)
CommandCards returns all data with cardType: command where the field and term matches
func (*InMemoryClient) ExtCommandCard ¶ added in v1.3.0
func (c *InMemoryClient) ExtCommandCard(name string) (*legiondata.CommandCard, error)
func (*InMemoryClient) ExtUnit ¶ added in v1.3.0
func (c *InMemoryClient) ExtUnit(name, rank string) (*legiondata.Unit, error)
func (*InMemoryClient) ExtUpgrade ¶ added in v1.3.0
func (c *InMemoryClient) ExtUpgrade(name string) (*legiondata.Upgrade, error)
func (*InMemoryClient) FetchAllData ¶ added in v1.3.0
func (c *InMemoryClient) FetchAllData()
func (*InMemoryClient) GetKeywords ¶ added in v1.3.0
func (c *InMemoryClient) GetKeywords(nameIn string) ([]Keyword, error)
Keywords returns a slice of keywords
func (*InMemoryClient) UnitCards ¶ added in v1.3.0
func (c *InMemoryClient) UnitCards(field, term string) ([]Unit, error)
UnitCards returns all data with cardType: unit where the field and term matches
func (*InMemoryClient) UpgradeCards ¶ added in v1.3.0
func (c *InMemoryClient) UpgradeCards(field, term string) ([]Upgrade, error)
UpgradeCards returns all data with cardType: upgrade
type Surge ¶
type Unit ¶
type Unit struct { Name string `json:"name"` Image string `json:"image"` Requirements []string `json:"requirements"` Faction string `json:"faction"` Keywords []string `json:"keywords"` Unique bool `json:"unique"` Cost int `json:"cost"` Rank string `json:"rank"` Slots []string `json:"slots"` CommandCards []CommandCard `json:"commandCards"` Wounds int `json:"wounds"` Courage *int `json:"courage,omitempty"` Resilience *int `json:"resilience,omitempty"` Defense string `json:"defense"` Entourage []string `json:"entourage"` Surge *Surge `json:"surge,omitempty"` Weapons []Weapon `json:"weapons"` Type string `json:"cardSubType" graphql:"cardSubType"` }
Unit is a standard Legion Unit
func CardToUnit ¶ added in v1.3.0
func CardToUnit(card *legionhq.Card, extUnit *legiondata.Unit) Unit
CardToUnit converts a legionhq card into a Unit
type Upgrade ¶
type Upgrade struct { Name string `json:"name"` Text string `json:"text"` Type string `json:"type" graphql:"cardSubType"` Image string `json:"image"` Requirements []string `json:"requirements"` Keywords []string `json:"keywords"` Cost int `json:"cost"` Exhaust bool `json:"exhaust"` Weapon *Weapon `json:"weapon"` UnitTypeExclusions []string `json:"unitTypeExclusions"` Unique bool `json:"unique"` }
func CardToUpgrade ¶ added in v1.3.0
func CardToUpgrade(card *legionhq.Card, extUpgrade *legiondata.Upgrade) Upgrade