Documentation ¶
Index ¶
- Constants
- func ExtractBases(cultures []*Culture) []string
- func ExtractGenderDominances(cultures []*Culture) []genderDominance.Dominance
- func ExtractLanguageSlugs(cultures []*Culture) []string
- func ExtractMartialCusoms(cultures []*Culture) []genderAcceptance.Acceptance
- func GenerateSlug(word string) string
- func GetEthosSimilarityCoef(e1, e2 Ethos) float64
- func LoadAllBases(opts ...types.ChangeStringFunc) chan either.Either[[]string]
- func LoadAllCultures(opts ...types.ChangeStringFunc) chan either.Either[*Culture]
- func LoadAllEthoses(opts ...types.ChangeStringFunc) chan either.Either[[]Ethos]
- func LoadAllRawCultures(opts ...types.ChangeStringFunc) chan either.Either[[]*RawCulture]
- func LoadAllSubbases(opts ...types.ChangeStringFunc) chan either.Either[[]*Subbase]
- func LoadAllTraditions(opts ...types.ChangeStringFunc) chan either.Either[[]*Tradition]
- func RandomBase(in []string) (string, error)
- func RandomMartialCustom(d genderDominance.Dominance) (genderAcceptance.Acceptance, error)
- func SelectBaseByMostRecent(in []string) (string, error)
- func SepareteCulturesByPresent(present []*Culture, ts []string) ([]string, []string)
- func SepareteTraditionsByPresent(present []*Tradition, ts []string) ([]string, []string)
- type CreateCultureOpts
- type Culture
- type Ethos
- type RawCulture
- type Subbase
- func ExtractSubbases(cultures []*Culture) []Subbase
- func FilterSubbasesByBaseSlug(subbases []Subbase, baseSlug string) []Subbase
- func RandomSubbase(in []Subbase) (Subbase, error)
- func SearchSubbase(slug string, opts ...types.ChangeStringFunc) (*Subbase, error)
- func SelectSubbaseByMostRecent(in []Subbase) (Subbase, error)
- type Tradition
- func ExtractTraditions(cultures []*Culture) []*Tradition
- func FilterTraditionsByDomitatedSex(in []*Tradition, ds gender.Sex) []*Tradition
- func FilterTraditionsByEthos(in []*Tradition, e Ethos) []*Tradition
- func RandomTraditions(ts []*Tradition, min, max int, e Ethos, ds gender.Sex) ([]*Tradition, error)
- func SearchTradition(slug string, opts ...types.ChangeStringFunc) (*Tradition, error)
- func SearchTraditions(slugs []string, opts ...types.ChangeStringFunc) ([]*Tradition, error)
- func UniqueTraditions(in []*Tradition) []*Tradition
- type TraditionType
Constants ¶
View Source
const ( MaxLoadDataChunkSize = 100 MaxLoadDataConcurrency = 10 RequiredCultureSlugSuffix = "_culture" RequiredBaseSlugSuffix = "_base" RequiredSubbaseSlugSuffix = "_subbase" RequiredEthosSlugSuffix = "_ethos" RequiredTraditionSlugSuffix = "_tradition" RequiredLanguageSlugSuffix = "_lang" )
Variables ¶
This section is empty.
Functions ¶
func ExtractBases ¶ added in v0.2.11
func ExtractGenderDominances ¶ added in v0.2.11
func ExtractGenderDominances(cultures []*Culture) []genderDominance.Dominance
func ExtractLanguageSlugs ¶ added in v0.2.11
func ExtractMartialCusoms ¶ added in v0.2.11
func ExtractMartialCusoms(cultures []*Culture) []genderAcceptance.Acceptance
func GenerateSlug ¶ added in v0.2.11
func GetEthosSimilarityCoef ¶
func LoadAllBases ¶ added in v0.2.9
func LoadAllBases(opts ...types.ChangeStringFunc) chan either.Either[[]string]
func LoadAllCultures ¶ added in v0.2.12
func LoadAllCultures(opts ...types.ChangeStringFunc) chan either.Either[*Culture]
func LoadAllEthoses ¶
func LoadAllEthoses(opts ...types.ChangeStringFunc) chan either.Either[[]Ethos]
func LoadAllRawCultures ¶ added in v0.2.10
func LoadAllRawCultures(opts ...types.ChangeStringFunc) chan either.Either[[]*RawCulture]
func LoadAllSubbases ¶ added in v0.2.9
func LoadAllSubbases(opts ...types.ChangeStringFunc) chan either.Either[[]*Subbase]
func LoadAllTraditions ¶
func LoadAllTraditions(opts ...types.ChangeStringFunc) chan either.Either[[]*Tradition]
func RandomBase ¶ added in v0.2.11
func RandomMartialCustom ¶ added in v0.2.11
func RandomMartialCustom(d genderDominance.Dominance) (genderAcceptance.Acceptance, error)
func SelectBaseByMostRecent ¶ added in v0.2.11
func SepareteCulturesByPresent ¶ added in v0.2.12
Types ¶
type CreateCultureOpts ¶ added in v0.2.11
type Culture ¶
type Culture struct { Slug string `json:"slug" bson:"slug"` BaseSlug string `json:"base_slug" bson:"base_slug"` Subbase Subbase `json:"subbase" bson:"subbase"` ParentCultures []*Culture `json:"parent_cultures" bson:"parent_cultures"` Ethos Ethos `json:"ethos" bson:"ethos"` Traditions []*Tradition `json:"traditions" bson:"traditions"` LanguageSlug string `json:"language_slug" bson:"language_slug"` GenderDominance genderDominance.Dominance `json:"gender_dominance" bson:"gender_dominance"` MartialCustom genderAcceptance.Acceptance `json:"martial_custom" bson:"martial_custom"` }
func Generate ¶ added in v0.2.11
func Generate(opts *CreateCultureOpts, parents ...*Culture) (*Culture, error)
Generate This method generates culture from already generated cultures Or it can generate from data from opts passing via arguments The method does not generate slug for the culture. It should be done by word_generator (Please, use GenrateSlug func for preparing generated word for using it as culture's slug)
func New ¶ added in v0.2.11
func New(opts *CreateCultureOpts) (*Culture, error)
func SearchCultures ¶ added in v0.2.12
func SearchCultures(slugs []string, opts ...types.ChangeStringFunc) ([]*Culture, error)
type Ethos ¶
type Ethos struct { Slug string `json:"slug" bson:"slug"` Description string `json:"description" bson:"description"` IsDiplomatic bool `json:"is_diplomatic" bson:"is_diplomatic"` IsWarlike bool `json:"is_warlike" bson:"is_warlike"` IsAdministrative bool `json:"is_administrative" bson:"is_administrative"` IsIntrigue bool `json:"is_intrigue" bson:"is_intrigue"` IsScholarly bool `json:"is_scholarly" bson:"is_scholarly"` }
func ExtractEthoses ¶
func RandomEthos ¶ added in v0.2.11
func SearchEthos ¶
func SearchEthos(slug string, opts ...types.ChangeStringFunc) (*Ethos, error)
func SelectEthosByMostRecent ¶ added in v0.2.11
func UniqueEthoses ¶
type RawCulture ¶
type RawCulture struct { Slug string `json:"slug" bson:"slug"` BaseSlug string `json:"base_slug" bson:"base_slug"` SubbaseSlug string `json:"subbase_slug" bson:"subbase_slug"` ParentCultureSlugs []string `json:"parent_culture_slugs" bson:"parent_culture_slugs"` EthosSlug string `json:"ethos_slug" bson:"ethos_slug"` TraditionSlugs []string `json:"tradition_slugs" bson:"tradition_slugs"` LanguageSlug string `json:"language_slug" bson:"language_slug"` GenderDominance genderDominance.Dominance `json:"gender_dominance" bson:"gender_dominance"` MartialCustom genderAcceptance.Acceptance `json:"martial_custom" bson:"martial_custom"` }
func FilterRawCulturesBySlugs ¶ added in v0.2.12
func FilterRawCulturesBySlugs(rCultures []*RawCulture, slugs []string) []*RawCulture
type Subbase ¶
type Subbase struct { Slug string `json:"slug" bson:"slug"` BaseSlug string `json:"base_slug" bson:"base_slug"` }
func ExtractSubbases ¶ added in v0.2.11
func FilterSubbasesByBaseSlug ¶ added in v0.2.11
func RandomSubbase ¶ added in v0.2.11
func SearchSubbase ¶ added in v0.2.12
func SearchSubbase(slug string, opts ...types.ChangeStringFunc) (*Subbase, error)
func SelectSubbaseByMostRecent ¶ added in v0.2.11
type Tradition ¶
type Tradition struct { Slug string `json:"slug" bson:"slug"` Description string `json:"description" bson:"description"` PreferredEthosSlugs []string `json:"preferred_ethos_slugs" bson:"preferred_ethos_slugs"` Type TraditionType `json:"type" bson:"type"` OmitTraditionSlugs []string `json:"omit_tradition_slugs" bson:"omit_tradition_slugs"` OmitGenderDominance []gender.Sex `json:"omit_gender_dominance" bson:"omit_gender_dominance"` OmitEthosSlugs []string `json:"omit_ethos_slugs" bson:"omit_ethos_slugs"` }
func ExtractTraditions ¶ added in v0.2.11
func FilterTraditionsByDomitatedSex ¶ added in v0.2.11
func FilterTraditionsByEthos ¶ added in v0.2.11
func RandomTraditions ¶ added in v0.2.11
func SearchTradition ¶
func SearchTradition(slug string, opts ...types.ChangeStringFunc) (*Tradition, error)
func SearchTraditions ¶ added in v0.2.12
func SearchTraditions(slugs []string, opts ...types.ChangeStringFunc) ([]*Tradition, error)
func UniqueTraditions ¶ added in v0.2.11
type TraditionType ¶
type TraditionType string
const ( RealmTraditionType TraditionType = "realm_tradition_type" RegionalTraditionType TraditionType = "regional_tradition_type" RitualTraditionType TraditionType = "ritual_tradition_type" SocialTraditionType TraditionType = "social_tradition_type" WarfareTraditionType TraditionType = "warfare_tradition_type" )
Click to show internal directories.
Click to hide internal directories.