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

Defines a faction record for the faction database. More...

Public Member Functions

 Faction ()
 
 Faction (int id, string name)
 
bool HasDirectParent (int parentID)
 Determines whether this faction has a direct parent with the specified parentID.
 
void AddDirectParent (int parentID)
 Adds a direct parent to this faction.
 
void RemoveDirectParent (int parentID)
 Removes a direct parent from this faction.
 
bool FindPersonalRelationship (int factionID, out Relationship relationship)
 Searches for a personal relationship from this faction to another.
 
bool HasPersonalRelationship (int factionID)
 Determines whether this faction has a personal relationship the specified factionID.
 
void RemovePersonalRelationship (int factionID)
 Removes the personal relationship record that this faction has for another faction, if that relationship record exists.
 
float GetPersonalRelationshipTrait (int factionID, int traitID)
 Gets a personal relationship trait to another faction.
 
void SetPersonalRelationshipTrait (int factionID, int traitID, float value, int numTraits)
 Sets a personal relationship trait to another faction.
 
void SetPersonalRelationshipInheritable (int factionID, bool inheritable)
 Sets a personal relationship inheritable or not inheritable.
 
float GetPersonalAffinity (int factionID)
 Gets the personal affinity to another faction.
 
void SetPersonalAffinity (int factionID, float affinity, int numTraits)
 Sets the personal affinity to another faction.
 

Public Attributes

int id
 The faction's unique ID.
 
string name = string.Empty
 The name of the faction.
 
string description = string.Empty
 The description of the faction.
 
int color = 0
 The color of the faction's gizmo in the scene view.
 
int[] parents = new int[0]
 The parent factions.
 
float[] traits = new float[0]
 The faction's personality traits.
 
List< Relationshiprelationships = new List<Relationship>()
 The relationships this faction feels toward other factions.
 
float percentJudgeParents = 0
 If nonzero, when setting a relationship to a subject also modify relationships to the subject's parents scaled by this amount.
 

Static Public Attributes

static string[] ColorNames
 
static string[] GizmoIconNames
 

Detailed Description

Defines a faction record for the faction database.

The scope of this class is an individual faction, with no awareness of other factions except as faction IDs in the parents and relationships arrays.

Constructor & Destructor Documentation

◆ Faction() [1/2]

PixelCrushers.LoveHate.Faction.Faction ( )
inline

◆ Faction() [2/2]

PixelCrushers.LoveHate.Faction.Faction ( int  id,
string  name 
)
inline

Member Function Documentation

◆ AddDirectParent()

void PixelCrushers.LoveHate.Faction.AddDirectParent ( int  parentID)
inline

Adds a direct parent to this faction.

Parameters
parentIDParent ID.

◆ FindPersonalRelationship()

bool PixelCrushers.LoveHate.Faction.FindPersonalRelationship ( int  factionID,
out Relationship  relationship 
)
inline

Searches for a personal relationship from this faction to another.

Returns
true, if a personal relationship was found, false otherwise.
Parameters
factionIDFaction ID to search for.
relationshipRelationship (if found).

◆ GetPersonalAffinity()

float PixelCrushers.LoveHate.Faction.GetPersonalAffinity ( int  factionID)
inline

Gets the personal affinity to another faction.

Returns
The personal affinity, or 0 if no personal relationship.
Parameters
factionIDFaction ID.

◆ GetPersonalRelationshipTrait()

float PixelCrushers.LoveHate.Faction.GetPersonalRelationshipTrait ( int  factionID,
int  traitID 
)
inline

Gets a personal relationship trait to another faction.

Returns
The personal relationship trait, or 0 if no personal relationship. If no personal relationship and the request is for affinity to self, returns 100.
Parameters
factionIDFaction ID.
traitIDTrait ID.

◆ HasDirectParent()

bool PixelCrushers.LoveHate.Faction.HasDirectParent ( int  parentID)
inline

Determines whether this faction has a direct parent with the specified parentID.

Returns
true if this faction has direct parent with the specified parentID; otherwise, false.
Parameters
parentIDParent ID.

◆ HasPersonalRelationship()

bool PixelCrushers.LoveHate.Faction.HasPersonalRelationship ( int  factionID)
inline

Determines whether this faction has a personal relationship the specified factionID.

Returns
true if this faction has a personal relationship the specified factionID; otherwise, false.
Parameters
factionIDFaction ID.

◆ RemoveDirectParent()

void PixelCrushers.LoveHate.Faction.RemoveDirectParent ( int  parentID)
inline

Removes a direct parent from this faction.

Parameters
parentIDParent ID.

◆ RemovePersonalRelationship()

void PixelCrushers.LoveHate.Faction.RemovePersonalRelationship ( int  factionID)
inline

Removes the personal relationship record that this faction has for another faction, if that relationship record exists.

Parameters
factionIDFaction ID.

◆ SetPersonalAffinity()

void PixelCrushers.LoveHate.Faction.SetPersonalAffinity ( int  factionID,
float  affinity,
int  numTraits 
)
inline

Sets the personal affinity to another faction.

Parameters
factionIDFaction ID.
affinityAffinity.
numTraitsSize of the traits list. Needed if this method has to create a new relationship traits list.

◆ SetPersonalRelationshipInheritable()

void PixelCrushers.LoveHate.Faction.SetPersonalRelationshipInheritable ( int  factionID,
bool  inheritable 
)
inline

Sets a personal relationship inheritable or not inheritable.

Parameters
factionIDFaction ID
valueInheritable value

◆ SetPersonalRelationshipTrait()

void PixelCrushers.LoveHate.Faction.SetPersonalRelationshipTrait ( int  factionID,
int  traitID,
float  value,
int  numTraits 
)
inline

Sets a personal relationship trait to another faction.

Parameters
factionIDFaction ID.
traitIDTrait ID.
valueValue.
numTraitsSize of the traits list. Needed if this method has to create a new relationship traits list.

Member Data Documentation

◆ color

int PixelCrushers.LoveHate.Faction.color = 0

The color of the faction's gizmo in the scene view.

◆ ColorNames

string [] PixelCrushers.LoveHate.Faction.ColorNames
static
Initial value:
= new string[]
{
"White",
"Black",
"Blue",
"Brown",
"Cyan",
"Green",
"Lime",
"Magenta",
"Orange",
"Pink",
"Red",
"Yellow"
}

◆ description

string PixelCrushers.LoveHate.Faction.description = string.Empty

The description of the faction.

◆ GizmoIconNames

string [] PixelCrushers.LoveHate.Faction.GizmoIconNames
static
Initial value:
= new string[]
{
"LoveHate/FactionMember_White",
"LoveHate/FactionMember_Black",
"LoveHate/FactionMember_Blue",
"LoveHate/FactionMember_Brown",
"LoveHate/FactionMember_Cyan",
"LoveHate/FactionMember_Green",
"LoveHate/FactionMember_Lime",
"LoveHate/FactionMember_Magenta",
"LoveHate/FactionMember_Orange",
"LoveHate/FactionMember_Pink",
"LoveHate/FactionMember_Red",
"LoveHate/FactionMember_Yellow"
}

◆ id

int PixelCrushers.LoveHate.Faction.id

The faction's unique ID.

◆ name

string PixelCrushers.LoveHate.Faction.name = string.Empty

The name of the faction.

◆ parents

int [] PixelCrushers.LoveHate.Faction.parents = new int[0]

The parent factions.

You only need to specify direct parents, as those parent factions may have their own parents (this faction's grandparents) and so on.

◆ percentJudgeParents

float PixelCrushers.LoveHate.Faction.percentJudgeParents = 0

If nonzero, when setting a relationship to a subject also modify relationships to the subject's parents scaled by this amount.

◆ relationships

List<Relationship> PixelCrushers.LoveHate.Faction.relationships = new List<Relationship>()

The relationships this faction feels toward other factions.

◆ traits

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

The faction's personality traits.


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