Loading...
Searching...
No Matches
PixelCrushers.LoveHate.Relationship Class Reference

Defines a relationship to another faction, which is a set of traits that always includes affinity as the first trait. More...

Collaboration diagram for PixelCrushers.LoveHate.Relationship:

Public Member Functions

 Relationship ()
 
 Relationship (int factionID, float[] traits)
 
 Relationship (int factionID, bool inheritable, float[] traits)
 
void Assign (int factionID, float[] traits)
 
void Assign (int factionID, bool inheritable, float[] traits)
 
float GetTrait (int index)
 
void SetTrait (int index, float value)
 

Static Public Member Functions

static float GetDefaultValue (int judgeFactionID, int subjectFactionID, int traitID)
 
static Relationship GetNew (int factionID, float[] traits)
 Gets a new relationship from the pool.
 
static Relationship GetNew (int factionID, bool inheritable, float[] traits)
 Gets a new relationship from the pool.
 
static void Release (Relationship relationship)
 Releases a relationship object back to the pool.
 

Public Attributes

int factionID = 0
 The ID of the faction this relationship is directed to.
 
bool inheritable = true
 Do child factions inherit this relationship?
 
float[] traits = new float[0]
 Relationship traits.
 

Static Public Attributes

const string AffinityTraitName = "Affinity"
 
const int AffinityTraitIndex = 0
 
static Pool< Relationshippool = new Pool<Relationship>()
 A static pool of objects, to prevent garbage collection stutter.
 

Properties

float affinity [get, set]
 

Detailed Description

Defines a relationship to another faction, which is a set of traits that always includes affinity as the first trait.

Constructor & Destructor Documentation

◆ Relationship() [1/3]

PixelCrushers.LoveHate.Relationship.Relationship ( )
inline

◆ Relationship() [2/3]

PixelCrushers.LoveHate.Relationship.Relationship ( int  factionID,
float[]  traits 
)
inline

◆ Relationship() [3/3]

PixelCrushers.LoveHate.Relationship.Relationship ( int  factionID,
bool  inheritable,
float[]  traits 
)
inline

Member Function Documentation

◆ Assign() [1/2]

void PixelCrushers.LoveHate.Relationship.Assign ( int  factionID,
bool  inheritable,
float[]  traits 
)
inline

◆ Assign() [2/2]

void PixelCrushers.LoveHate.Relationship.Assign ( int  factionID,
float[]  traits 
)
inline

◆ GetDefaultValue()

static float PixelCrushers.LoveHate.Relationship.GetDefaultValue ( int  judgeFactionID,
int  subjectFactionID,
int  traitID 
)
inlinestatic

◆ GetNew() [1/2]

static Relationship PixelCrushers.LoveHate.Relationship.GetNew ( int  factionID,
bool  inheritable,
float[]  traits 
)
inlinestatic

Gets a new relationship from the pool.

Returns
The new relationship.
Parameters
factionIDFaction ID.
traitsTraits.

◆ GetNew() [2/2]

static Relationship PixelCrushers.LoveHate.Relationship.GetNew ( int  factionID,
float[]  traits 
)
inlinestatic

Gets a new relationship from the pool.

Returns
The new relationship.
Parameters
factionIDFaction ID.
traitsTraits.

◆ GetTrait()

float PixelCrushers.LoveHate.Relationship.GetTrait ( int  index)
inline

◆ Release()

static void PixelCrushers.LoveHate.Relationship.Release ( Relationship  relationship)
inlinestatic

Releases a relationship object back to the pool.

Parameters
deedDeed.

◆ SetTrait()

void PixelCrushers.LoveHate.Relationship.SetTrait ( int  index,
float  value 
)
inline

Member Data Documentation

◆ AffinityTraitIndex

const int PixelCrushers.LoveHate.Relationship.AffinityTraitIndex = 0
static

◆ AffinityTraitName

const string PixelCrushers.LoveHate.Relationship.AffinityTraitName = "Affinity"
static

◆ factionID

int PixelCrushers.LoveHate.Relationship.factionID = 0

The ID of the faction this relationship is directed to.

◆ inheritable

bool PixelCrushers.LoveHate.Relationship.inheritable = true

Do child factions inherit this relationship?

◆ pool

Pool<Relationship> PixelCrushers.LoveHate.Relationship.pool = new Pool<Relationship>()
static

A static pool of objects, to prevent garbage collection stutter.

◆ traits

float [] PixelCrushers.LoveHate.Relationship.traits = new float[0]

Relationship traits.

The first trait is always affinity.

Property Documentation

◆ affinity

float PixelCrushers.LoveHate.Relationship.affinity
getset

The documentation for this class was generated from the following file: