Coordinates data exchange between factions. More...
Public Member Functions | |
virtual void | ResetAll () |
Resets faction database and all registered faction members. | |
Faction | GetFaction (int factionID) |
Looks up a faction by its ID. | |
Faction | GetFactionSilent (int factionID) |
Looks up a faction by its ID. | |
Faction | GetFaction (int factionID, bool silent) |
Looks up a faction by its ID. | |
Faction | GetFaction (string factionName) |
Looks up a faction by its name. | |
int | GetFactionID (string factionName) |
Looks up a faction ID by its name. | |
void | RegisterFactionMember (FactionMember member) |
Registers a faction member. | |
void | UnregisterFactionMember (FactionMember member) |
Unregisters a faction member. | |
bool | FactionHasAncestor (int factionID, int ancestorID) |
Checks if a faction has an ancestor (parent, grandparent, etc.) | |
bool | FactionHasDirectParent (int factionID, int parentID) |
Checks if a faction has a direct parent. | |
void | AddFactionParent (int factionID, int parentID) |
Adds a parent to a faction. | |
void | RemoveFactionParent (int factionID, int parentID, bool inheritRelationships) |
Removes a parent from a faction. | |
bool | FindPersonalAffinity (int judgeFactionID, int subjectFactionID, out float affinity) |
Finds this 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 for the subject based on the other's affinity for this faction. | |
void | CommitDeed (FactionMember actor, Deed deed, bool requiresSight, Dimension dimension, float radius) |
Informs factions that a deed was committed. | |
void | CommitDeed (FactionMember actor, Deed deed, bool requiresSight) |
Commits the deed. | |
string | SerializeToString () |
void | DeserializeFromString (string s) |
Static Public Member Functions | |
static List< string > | ZonePluginActivator () |
For optional UtopiaWorx Zone Controller integration. | |
static List< string > | ZonePluginActivatorMethods () |
For optional UtopiaWorx Zone Controller integration. | |
Public Attributes | |
FactionDatabase | factionDatabase |
The faction database managed by this faction manager. | |
int | witnessesPerUpdate = 60 |
When a deed is committed, process this many potential witnesses each Update. | |
bool | canWitnessSelf = false |
Faction members can witness their own deeds. | |
bool | allowOnlyOneFactionManager = false |
If a faction manager already exists when this one tries to start, destroy this one instead. | |
bool | debug |
Tick to log activity to the console. | |
Protected Member Functions | |
virtual void | Awake () |
virtual void | Start () |
Properties | |
Dictionary< int, Faction > | factions [get] |
Dictionary< Faction, List< FactionMember > > | members [get] |
static FactionManager | instance [get, set] |
Coordinates data exchange between factions.
If your scene has any faction members, it must have a faction manager.
|
inline |
Adds a parent to a faction.
factionID | Faction ID. |
parentID | Parent ID. |
|
inlineprotectedvirtual |
|
inline |
Commits the deed.
This version has no distance restrictions.
actor | Actor. |
deed | Deed. |
requiresSight | If set to true requires sight. |
|
inline |
Informs factions that a deed was committed.
actor | FactionMember who committed the deed. |
deed | Deed. |
requiresSight | If true , the deed must be seen to be witnessed. |
dimension | The world space dimension to use for radius checks. |
radius | Max distance from position that factions can witness the deed (0=anywhere). |
|
inline |
|
inline |
Checks if a faction has an ancestor (parent, grandparent, etc.)
true
, if has ancestor, false
otherwise.factionID | Faction ID. |
ancestorID | Ancestor ID. |
|
inline |
Checks if a faction has a direct parent.
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 this 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 |
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 |
Looks up a faction by its ID.
factionID | Faction ID. |
|
inline |
Looks up a faction by its ID.
factionID | Faction ID. |
silent | If set to true , don't log warnings. |
|
inline |
Looks up a faction by its name.
factionName | Faction name. |
|
inline |
Looks up a faction ID by its name.
factionName | Faction name. |
|
inline |
Looks up a faction by its ID.
Doesn't log any warning messages.
factionID | Faction ID. |
|
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 |
Registers a faction member.
The faction member calls this in Start.
member | Member. |
|
inline |
Removes a parent from a faction.
factionID | Faction ID. |
parentID | Parent ID. |
inheritRelationships | If set to true keep the parent's relationships if the faction doesn't already have a personal relationship. |
|
inlinevirtual |
Resets faction database and all registered faction members.
|
inline |
|
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 |
If the faction has personal affinity for a subject and the other doesn't, this gives the other an affinity for the subject based on the other's affinity for this faction.
judgeFactionID | Judging faction ID (gives affinity). |
otherFactionID | Other faction ID (maybe receives affinity). |
subjectFactionID | Subject faction ID (affinity about this faction). |
|
inlineprotectedvirtual |
Reimplemented in PixelCrushers.LoveHate.ORKFrameworkSupport.OrkFactionManager.
|
inline |
Unregisters a faction member.
The faction member calls this in OnDestroy.
member | Member. |
|
inlinestatic |
For optional UtopiaWorx Zone Controller integration.
|
inlinestatic |
For optional UtopiaWorx Zone Controller integration.
bool PixelCrushers.LoveHate.FactionManager.allowOnlyOneFactionManager = false |
If a faction manager already exists when this one tries to start, destroy this one instead.
bool PixelCrushers.LoveHate.FactionManager.canWitnessSelf = false |
Faction members can witness their own deeds.
bool PixelCrushers.LoveHate.FactionManager.debug |
Tick to log activity to the console.
FactionDatabase PixelCrushers.LoveHate.FactionManager.factionDatabase |
The faction database managed by this faction manager.
int PixelCrushers.LoveHate.FactionManager.witnessesPerUpdate = 60 |
When a deed is committed, process this many potential witnesses each Update.
|
get |
|
staticgetset |
|
get |