22 lines
628 B
Go
Raw Normal View History

2019-06-03 09:32:43 +00:00
package arn
// Register a list of supported character roles.
func init() {
DataLists["anime-character-roles"] = []*Option{
{"main", "Main character"},
{"supporting", "Supporting character"},
}
}
2019-09-10 00:49:51 +00:00
// AnimeCharacter contains the information for a character and his role in an anime.
2019-06-03 09:32:43 +00:00
type AnimeCharacter struct {
CharacterID string `json:"characterId" editable:"true"`
Role string `json:"role" editable:"true" datalist:"anime-character-roles"`
}
2019-09-10 00:49:51 +00:00
// Character returns the referenced character.
2019-06-03 09:32:43 +00:00
func (char *AnimeCharacter) Character() *Character {
character, _ := GetCharacter(char.CharacterID)
return character
}