package horse

type CharacterID int16

type Character struct {
	ID   CharacterID `json:"chara_id"`
	Name string      `json:"name"`
}

func (c Character) String() string {
	return c.Name
}

type AffinityRelation struct {
	IDA      int `json:"chara_a"`
	IDB      int `json:"chara_b"`
	IDC      int `json:"chara_c,omitzero"`
	Affinity int `json:"affinity"`
}

// Conversation describes a lobby conversation.
type Conversation struct {
	// CharacterID is the ID of the character who has the conversation as
	// a gallery entry.
	CharacterID CharacterID `json:"chara_id"`
	// Number is the conversation number within the character's gallery.
	Number int `json:"number"`
	// Location is the ID of the location the conversation occurs in the lobby.
	Location LobbyConversationLocationID `json:"location"`
	// LocationName is the name of the lobby location, for convenience.
	LocationName string `json:"location_name"`
	// Chara1 is the first conversation participant ID.
	// It does not necessarily match CharacterID.
	Chara1 CharacterID `json:"chara_1"`
	// Chara2 is the second conversation participant ID.
	Chara2 CharacterID `json:"chara_2,omitzero"`
	// Chara3 is the third conversation participant ID.
	Chara3 CharacterID `json:"chara_3,omitzero"`
	// ConditionType is a complete mystery to me.
	ConditionType int `json:"condition_type"`
}

type LobbyConversationLocationID int

//go:generate go run golang.org/x/tools/cmd/stringer@v0.41.0 -type LobbyConversationLocationID -trimprefix Lobby -linecomment
const (
	LobbyRightFront1 LobbyConversationLocationID = 110 // right side front
	LobbyRightFront2 LobbyConversationLocationID = 120 // right side front
	LobbyRightFront3 LobbyConversationLocationID = 130 // right side front
	LobbyLeftTable1  LobbyConversationLocationID = 210 // left side table
	LobbyLeftTable2  LobbyConversationLocationID = 220 // left side table
	LobbyBackSeat    LobbyConversationLocationID = 310 // center back seat
	LobbyPosters1    LobbyConversationLocationID = 410 // center posters
	LobbyPosters2    LobbyConversationLocationID = 420 // center posters
	LobbyPosters3    LobbyConversationLocationID = 430 // center posters
	LobbySchoolMap1  LobbyConversationLocationID = 510 // left side school map
	LobbySchoolMap2  LobbyConversationLocationID = 520 // left side school map
	LobbySchoolMap3  LobbyConversationLocationID = 530 // left side school map
)
