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< Relationship > | relationships = 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 |
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.
|
inline |
|
inline |
|
inline |
Adds a direct parent to this faction.
parentID | Parent ID. |
|
inline |
Searches for a personal relationship from this faction to another.
true
, if a personal relationship was found, false
otherwise.factionID | Faction ID to search for. |
relationship | Relationship (if found). |
|
inline |
Gets the personal affinity to another faction.
0
if no personal relationship.factionID | Faction ID. |
|
inline |
Gets a personal relationship trait to another faction.
0
if no personal relationship. If no personal relationship and the request is for affinity to self, returns 100
.factionID | Faction ID. |
traitID | Trait ID. |
|
inline |
Determines whether this faction has a direct parent with the specified parentID.
true
if this faction has direct parent with the specified parentID; otherwise, false
.parentID | Parent ID. |
|
inline |
Determines whether this faction has a personal relationship the specified factionID.
true
if this faction has a personal relationship the specified factionID; otherwise, false
.factionID | Faction ID. |
|
inline |
Removes a direct parent from this faction.
parentID | Parent ID. |
|
inline |
Removes the personal relationship record that this faction has for another faction, if that relationship record exists.
factionID | Faction ID. |
|
inline |
Sets the personal affinity to another faction.
factionID | Faction ID. |
affinity | Affinity. |
numTraits | Size of the traits list. Needed if this method has to create a new relationship traits list. |
|
inline |
Sets a personal relationship inheritable or not inheritable.
factionID | Faction ID |
value | Inheritable value |
|
inline |
Sets a personal relationship trait to another faction.
factionID | Faction ID. |
traitID | Trait ID. |
value | Value. |
numTraits | Size of the traits list. Needed if this method has to create a new relationship traits list. |
int PixelCrushers.LoveHate.Faction.color = 0 |
The color of the faction's gizmo in the scene view.
|
static |
string PixelCrushers.LoveHate.Faction.description = string.Empty |
The description of the faction.
|
static |
int PixelCrushers.LoveHate.Faction.id |
The faction's unique ID.
string PixelCrushers.LoveHate.Faction.name = string.Empty |
The name of the faction.
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.
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.
List<Relationship> PixelCrushers.LoveHate.Faction.relationships = new List<Relationship>() |
The relationships this faction feels toward other factions.
float [] PixelCrushers.LoveHate.Faction.traits = new float[0] |
The faction's personality traits.