Documentation ¶
Index ¶
- Constants
- Variables
- func GetHairColorStr(g *genetics.Genes) string
- func SetEyeColor(g *genetics.Genes, val EyeColor)
- func SetGender(g *genetics.Genes, val Gender)
- func SetHairColor(g *genetics.Genes, val HairColor, curls bool)
- func String(g genetics.Genes) string
- type Attrs
- type EyeColor
- type FiveFactor
- type Gender
- type HairColor
- type Stats
- type Trait
Constants ¶
const ( TraitDeceptive = 1 << iota TraitHonest TraitAggressive TraitCalm TraitCowardly TraitBrave TraitAmbitious TraitContent TraitCareless TraitCareful TraitParanoid TraitTrusting TraitCruel TraitKind TraitShy TraitGregarious TraitArrogant TraitHumble TraitMax )
The various traits of a person.
const ( TraitMaxVal = 15 TraitHigh = TraitMaxVal / 3 * 2 TraitMid = TraitMaxVal / 2 TraitLow = TraitMaxVal / 3 )
Variables ¶
var ( GGender = genetics.Gene{ NumBits: 2, Offset: 62, } GEyeColor = genetics.Gene{ NumBits: 2, Offset: 60, } GHairColor = genetics.Gene{ NumBits: 3, Offset: 57, } GComplexion = genetics.Gene{ NumBits: 4, Offset: 53, } GHeight = genetics.Gene{ NumBits: 3, Offset: 50, } GMass = genetics.Gene{ NumBits: 3, Offset: 47, } GGrowth = genetics.Gene{ NumBits: 3, Offset: 44, } GStrength = genetics.Gene{ NumBits: 4, Offset: 40, } GIntelligence = genetics.Gene{ NumBits: 4, Offset: 36, } GDexterity = genetics.Gene{ NumBits: 4, Offset: 32, } GResilience = genetics.Gene{ NumBits: 4, Offset: 28, } GOpenness = genetics.Gene{ NumBits: 4, Offset: 24, } GConscientiousness = genetics.Gene{ NumBits: 4, Offset: 20, } GExtraversion = genetics.Gene{ NumBits: 4, Offset: 16, } GAgreeableness = genetics.Gene{ NumBits: 4, Offset: 12, } GNeuroticism = genetics.Gene{ NumBits: 4, Offset: 8, } )
Functions ¶
func GetHairColorStr ¶
GetHairColorStr returns a string representation of the hair color of a person.
func SetEyeColor ¶
SetEyeColor sets the eye color of a person based on their genes.
func SetHairColor ¶
SetHairColor sets the hair color of a person based on their genes.
Types ¶
type Attrs ¶
type EyeColor ¶
type EyeColor int
EyeColor represents the eye color of a person.
const ( EyeColorRed EyeColor = 0x0 EyeColorBlue EyeColor = 0x1 EyeColorGreen EyeColor = 0x2 EyeColorBrown EyeColor = 0x3 )
The various eye colors of a person.
func GetEyeColor ¶
GetEyeColor returns the eye color of a person based on their genes.
type FiveFactor ¶
type FiveFactor struct { Openness int // openness to experience Conscientiousness int // conscientiousness Extraversion int // extraversion Agreeableness int // agreeableness Neuroticism int // neuroticism }
FiveFactor represents a simplified version of the five factor personality model.
func GetFiveFactor ¶
func GetFiveFactor(g *genetics.Genes) FiveFactor
GetFiveFactor returns the five factor personality of a person based on their genes.
func (FiveFactor) String ¶
func (s FiveFactor) String() string
String returns a string representation of the five factor personality.
type Gender ¶
type Gender int
Gemder represents the gender of a person.
type HairColor ¶
type HairColor int
HairColor represents the hair color of a person.
type Stats ¶
Stats represents the physical stats of a person. This includes strength, intelligence, dexterity, and resilience.
type Trait ¶
type Trait int
func GetTraits ¶
func GetTraits(ff FiveFactor) Trait
GetTraits returns the traits of a person based on their five factor personality.