A faction database is a collection of traits, presets, and factions. More...
Public Member Functions | |
void | Initialize () |
int | CreateNewFaction (string factionName, string description) |
Creates a new faction in the faction database. | |
void | DestroyFaction (string factionName) |
Permanently removes a faction from the faction database. | |
void | DestroyFaction (int factionID) |
Permanently removes a faction from the faction database. | |
Faction | GetFaction (int factionID) |
Gets the faction with the specified faction ID. | |
Faction | GetFaction (string factionName) |
Gets the faction with the specified name. | |
int | GetFactionID (string factionName) |
Gets a faction's ID from its name. | |
bool | FactionHasAncestor (int factionID, int ancestorID) |
Determines whether a faction has another faction as its parent, grandparent, etc. | |
bool | FactionHasDirectParent (int factionID, int parentID) |
Determines whether a faction has another faction as one of its direct parents. | |
void | AddFactionParent (int factionID, int parentID) |
Adds a direct parent to a faction. | |
void | RemoveFactionParent (int factionID, int parentID, bool inheritRelationships) |
Removes a direction parent from a faction. | |
int | GetPersonalityTraitID (string traitName) |
Gets a personality trait ID by its name. | |
float | GetPersonalityTrait (string factionName, int traitID) |
Gets a faction's personality trait value. | |
float | GetPersonalityTrait (int factionID, int traitID) |
Gets a faction's personality trait value. | |
void | SetPersonalityTrait (string factionName, int traitID, float value) |
Sets a faction's personality trait value. | |
void | SetPersonalityTrait (int factionID, int traitID, float value) |
Sets a faction's personality trait value. | |
int | GetRelationshipTraitID (string traitName) |
Gets a relationship trait ID by its name. | |
void | InheritTraitsFromParents (string factionName) |
Sets a faction's traits to the average of its parents' traits. | |
void | InheritTraitsFromParents (string factionName, FactionInheritanceType inheritanceType) |
Sets a faction's traits to its inherited parents' traits. | |
void | InheritTraitsFromParents (int factionID) |
Sets a faction's traits to the average of its parents' traits. | |
void | InheritTraitsFromParents (int factionID, FactionInheritanceType inheritanceType) |
Sets a faction's traits to its inherited parents' traits. | |
bool | FindPersonalRelationship (int judgeFactionID, int subjectFactionID, out Relationship relationship) |
Finds the personal relationship trait of a judging faction to a subject faction if it exists. | |
bool | FindPersonalRelationshipTrait (int judgeFactionID, int subjectFactionID, int traitID, out float value) |
Finds the personal relationship trait of a judging faction to a subject faction if it exists. | |
bool | FindRelationshipTrait (int judgeFactionID, int subjectFactionID, int traitID, out float value) |
Finds the relationship trait of a judging faction to a subject faction. | |
float | GetRelationshipTrait (int judgeFactionID, int subjectFactionID, int traitID) |
Gets a relationship trait of a judging faction to a subject faction. | |
float | GetRelationshipTrait (string judgeFactionName, string subjectFactionName, int traitID) |
Gets a judge's relationship trait to a subject using their faction names. | |
void | SetPersonalRelationshipTrait (int judgeFactionID, int subjectFactionID, int traitID, float value) |
Sets a faction's personal relationship trait to another faction. | |
void | SetPersonalRelationshipTrait (string judgeFactionName, string subjectFactionName, int traitID, float value) |
Sets a faction's personal relationship trait to another faction. | |
void | ModifyPersonalRelationshipTrait (int judgeFactionID, int subjectFactionID, int traitID, float change) |
Modifies (increments or decrements) a judge's personal relationship trait to a subject using their faction IDs. | |
void | ModifyPersonalRelationshipTrait (string judgeFactionName, string subjectFactionName, int traitID, float change) |
Modifies (increments or decrements) a judge's personal affinity to a subject using their faction names. | |
void | SetPersonalRelationshipInheritable (int judgeFactionID, int subjectFactionID, bool inheritable) |
void | SetPersonalRelationshipInheritable (string judgeFactionName, string subjectFactionName, bool inheritable) |
void | ShareRelationshipTraits (int judgeFactionID, int otherFactionID, int subjectFactionID) |
If the faction has personal relationship traits for a subject and the other doesn't, this gives them to the other based on the other's affinity for this faction. | |
bool | FindPersonalAffinity (int judgeFactionID, int subjectFactionID, out float affinity) |
Finds a faction's personal affinity for another faction. | |
bool | FindAffinity (int judgeFactionID, int subjectFactionID, out float affinity) |
Finds the affinity of a judging faction to a subject faction. | |
float | GetAffinity (int judgeFactionID, int subjectFactionID) |
Gets the affinity of a judging faction to a subject faction. | |
float | GetAffinity (string judgeFactionName, string subjectFactionName) |
Gets a judge's affinity to a subject using their faction names. | |
void | SetPersonalAffinity (int judgeFactionID, int subjectFactionID, float affinity) |
Sets this faction's personal affinity to another faction. | |
void | SetPersonalAffinity (string judgeFactionName, string subjectFactionName, float affinity) |
Sets a judge's personal affinity to a subject using their faction names. | |
void | ModifyPersonalAffinity (int judgeFactionID, int subjectFactionID, float affinityChange) |
Modifies (increments or decrements) a judge's personal affinity to a subject using their faction IDs. | |
void | ModifyPersonalAffinity (string judgeFactionName, string subjectFactionName, float affinityChange) |
Modifies (increments or decrements) a judge's personal affinity to a subject using their faction names. | |
void | ShareAffinity (int judgeFactionID, int otherFactionID, int subjectFactionID) |
If the faction has personal affinity for a subject and the other doesn't, this gives the other an affinity (and all other relationship traits) for the subject based on the other's affinity for this faction. | |
Public Attributes | |
TraitDefinition[] | personalityTraitDefinitions = new TraitDefinition[0] |
The personality trait definitions. | |
TraitDefinition[] | relationshipTraitDefinitions = new TraitDefinition[1] { new TraitDefinition("Affinity", "(Required)") } |
The relationship trait definitions. | |
Preset[] | presets = new Preset[0] |
The presets. | |
Faction[] | factions = new Faction[0] |
The factions. | |
FactionInheritanceType | traitInheritanceType = FactionInheritanceType.Average |
How traits are inherited from parents. | |
FactionInheritanceType | relationshipInheritanceType = FactionInheritanceType.Average |
How relationships are inherited from parents. | |
int | nextID = 0 |
The next faction ID, used by the custom editor to auto-number factions. | |
Static Public Attributes | |
const int | PlayerFactionID = 0 |
Faction ID 0 is reserved for the player. | |
Events | |
PersonalityTraitChangedDelegate | personalityTraitChanged = delegate { } |
A faction database is a collection of traits, presets, and factions.
The scope of a faction database is the definition of traits, presets, and factions, with no awareness of faction members or other scene-level objects.
|
inline |
Adds a direct parent to a faction.
factionID | Faction ID. |
parentID | Parent ID. |
|
inline |
Creates a new faction in the faction database.
factionName | Faction name. |
|
inline |
Permanently removes a faction from the faction database.
factionID | Faction ID. |
|
inline |
Permanently removes a faction from the faction database.
factionName | Faction name. |
|
inline |
Determines whether a faction has another faction as its parent, grandparent, etc.
true
, if has ancestor, false
otherwise.factionID | Faction ID. |
ancestorID | Ancestor ID. |
|
inline |
Determines whether a faction has another faction as one of its direct parents.
true
, if has direct parent, false
otherwise.factionID | Faction ID. |
parentID | Parent ID. |
|
inline |
Finds the affinity of a judging faction to a subject faction.
true
, if affinity was found, false
otherwise.judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
affinity | Affinity of judge to subject. |
|
inline |
Finds a faction's personal affinity for another faction.
Doesn't check parents.
true
if personal affinity was found, false
otherwise.subjectFactionID | The other faction ID. |
affinity | Affinity of this faction to the subject. |
|
inline |
Finds the personal relationship trait of a judging faction to a subject faction if it exists.
true
, if personal relationship was found, false
otherwise.judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
traitID | Trait ID. |
value | Trait value of judge to subject. |
|
inline |
Finds the personal relationship trait of a judging faction to a subject faction if it exists.
true
, if personal relationship was found, false
otherwise.judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
traitID | Trait ID. |
value | Trait value of judge to subject. |
|
inline |
Finds the relationship trait of a judging faction to a subject faction.
true
, if relationship was found, false
otherwise.judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
traitID | Trait ID. |
value | Trait value of judge to subject. |
|
inline |
Gets the affinity of a judging faction to a subject faction.
judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
|
inline |
Gets a judge's affinity to a subject using their faction names.
judgeFactionName | Judge faction name. |
subjectFactionName | Subject faction name. |
|
inline |
Gets the faction with the specified faction ID.
null
if no faction exists with the ID.factionID | Faction ID. |
|
inline |
Gets the faction with the specified name.
null
if no faction exists by that name.factionName | Faction name. |
|
inline |
Gets a faction's ID from its name.
-1
if no faction exists by that name.factionName | Faction name. |
|
inline |
Gets a faction's personality trait value.
factionID | Faction. |
traitID | Trait ID. |
|
inline |
Gets a faction's personality trait value.
factionName | Faction. |
traitID | Trait ID. |
|
inline |
Gets a personality trait ID by its name.
traitName | Trait name. |
|
inline |
Gets a relationship trait of a judging faction to a subject faction.
judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
traitID | Trait ID. |
|
inline |
Gets a judge's relationship trait to a subject using their faction names.
judgeFactionName | Judge faction name. |
subjectFactionName | Subject faction name. |
traitID | Trait ID. |
|
inline |
Gets a relationship trait ID by its name.
traitName | Trait name. |
|
inline |
Sets a faction's traits to the average of its parents' traits.
factionID | Faction name. |
|
inline |
Sets a faction's traits to its inherited parents' traits.
factionID | Faction name. |
inheritanceType | How to handle inheritance. |
|
inline |
Sets a faction's traits to the average of its parents' traits.
factionName | Faction name. |
|
inline |
Sets a faction's traits to its inherited parents' traits.
factionName | Faction name. |
inheritanceType | How to handle inheritance. |
|
inline |
|
inline |
Modifies (increments or decrements) a judge's personal affinity to a subject using their faction IDs.
judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
affinityChange | Affinity change. |
|
inline |
Modifies (increments or decrements) a judge's personal affinity to a subject using their faction names.
judgeFactionName | Judge faction name. |
subjectFactionName | Subject faction name. |
affinityChange | Affinity change. |
|
inline |
Modifies (increments or decrements) a judge's personal relationship trait to a subject using their faction IDs.
judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
traitID | Trait ID. |
change | Value change. |
|
inline |
Modifies (increments or decrements) a judge's personal affinity to a subject using their faction names.
judgeFactionName | Judge faction name. |
subjectFactionName | Subject faction name. |
traitID | Trait ID. |
change | Value change. |
|
inline |
Removes a direction parent from a faction.
factionID | Faction ID. |
parentID | Parent ID. |
inheritRelationships | If set to true inherit any of the parents' relationships for which the faction doesn't already have a personal relationship. |
|
inline |
Sets this faction's personal affinity to another faction.
subjectFactionID | Subject faction ID. |
affinity | Affinity to the other faction. |
|
inline |
Sets a judge's personal affinity to a subject using their faction names.
judgeFactionName | Judge faction name. |
subjectFactionName | Subject faction name. |
affinity | Affinity. |
|
inline |
Sets a faction's personality trait value.
factionID | Faction. |
traitID | Trait ID. |
value | New value. |
|
inline |
Sets a faction's personality trait value.
factionName | Faction. |
traitID | Trait ID. |
value | New value. |
|
inline |
|
inline |
|
inline |
Sets a faction's personal relationship trait to another faction.
judgeFactionID | Judge faction ID. |
subjectFactionID | Subject faction ID. |
traitID | Trait ID. |
value | Trait value. |
|
inline |
Sets a faction's personal relationship trait to another faction.
judgeFactionName | Judge faction name. |
subjectFactionName | Subject faction name. |
traitID | Trait ID. |
value | Trait value. |
|
inline |
If the faction has personal affinity for a subject and the other doesn't, this gives the other an affinity (and all other relationship traits) for the subject based on the other's affinity for this faction.
other | A member of a faction. |
subjectFactionID | Subject faction ID. |
|
inline |
If the faction has personal relationship traits for a subject and the other doesn't, this gives them to the other based on the other's affinity for this faction.
judgeFactionID | Judge faction ID (gives traits). |
otherFactionID | Other faction ID (maybe receives traits). |
subjectFactionID | Subject faction ID (traits about this faction). |
int PixelCrushers.LoveHate.FactionDatabase.nextID = 0 |
The next faction ID, used by the custom editor to auto-number factions.
TraitDefinition [] PixelCrushers.LoveHate.FactionDatabase.personalityTraitDefinitions = new TraitDefinition[0] |
The personality trait definitions.
Used for factions, deeds, and presets.
|
static |
Faction ID 0 is reserved for the player.
FactionInheritanceType PixelCrushers.LoveHate.FactionDatabase.relationshipInheritanceType = FactionInheritanceType.Average |
How relationships are inherited from parents.
TraitDefinition [] PixelCrushers.LoveHate.FactionDatabase.relationshipTraitDefinitions = new TraitDefinition[1] { new TraitDefinition("Affinity", "(Required)") } |
The relationship trait definitions.
Used for relationships.
FactionInheritanceType PixelCrushers.LoveHate.FactionDatabase.traitInheritanceType = FactionInheritanceType.Average |
How traits are inherited from parents.
PersonalityTraitChangedDelegate PixelCrushers.LoveHate.FactionDatabase.personalityTraitChanged = delegate { } |