Class SettlementProperty
Component to Settlement that handles spawning/despawning stakes and claims as citizens come and go.
Handles property crises when not enough citizens for property.
Inheritance
System.Object
SettlementProperty
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public class SettlementProperty : Object, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IController, IViewController, IHasUniversalID, INotifyPropertyChanged
Constructors
SettlementProperty()
Declaration
public SettlementProperty()
Fields
ClaimsAndStakesUpdatedEvent
Declaration
public ThreadSafeAction ClaimsAndStakesUpdatedEvent
Field Value
PropertyCrisisChangedEvent
Declaration
public ThreadSafeAction<bool> PropertyCrisisChangedEvent
Field Value
PropertyCrisisStartTime
Declaration
public double PropertyCrisisStartTime
Field Value
Type |
Description |
System.Double |
|
Properties
ControllerID
Declaration
public ref int ControllerID { get; }
Property Value
Type |
Description |
System.Int32 |
|
HasPropertyCrisis
Declaration
public bool HasPropertyCrisis { get; }
Property Value
Type |
Description |
System.Boolean |
|
HomesteadSupportClaimsPerAbandonedCitizen
Declaration
public float HomesteadSupportClaimsPerAbandonedCitizen { get; }
Property Value
Type |
Description |
System.Single |
|
HomesteadSupportClaimsPerCitizen
Declaration
public float HomesteadSupportClaimsPerCitizen { get; }
Property Value
Type |
Description |
System.Single |
|
SettlementClaimsPerAbandonedCitizen
Declaration
public float SettlementClaimsPerAbandonedCitizen { get; }
Property Value
Type |
Description |
System.Single |
|
SettlementClaimsPerCitizen
Declaration
public float SettlementClaimsPerCitizen { get; }
Property Value
Type |
Description |
System.Single |
|
SpawnedClaims
Declaration
public SpawnedClaims SpawnedClaims { get; }
Property Value
SpawnOrDespawnClaims
Declaration
public SettlementProperty.ChangeInventoryEvent SpawnOrDespawnClaims { get; set; }
Property Value
StakesInfluencedBySettlement
These are all the stakes used by this settlement (all the stakes currently influenced by this settlement).
Declaration
public ControllerList<SettlementClaimStakeObject> StakesInfluencedBySettlement { get; }
Property Value
StakesPerAbandonedCitizen
Declaration
public float StakesPerAbandonedCitizen { get; }
Property Value
Type |
Description |
System.Single |
|
StakesPerCitizen
Declaration
public float StakesPerCitizen { get; }
Property Value
Type |
Description |
System.Single |
|
Subscriptions
Declaration
public ref ThreadSafeSubscriptions Subscriptions { get; }
Property Value
Methods
BuildCrisisMailNotice(LocString)
Declaration
public LocString BuildCrisisMailNotice(LocString destinationDesc)
Parameters
Type |
Name |
Description |
LocString |
destinationDesc |
|
Returns
BuildCrisisNotice(LocString)
Creates a crisis notice for the current time.
destinationDesc
A description of where to return the stakes and claims.
Declaration
public LocString BuildCrisisNotice(LocString destinationDesc)
Parameters
Type |
Name |
Description |
LocString |
destinationDesc |
|
Returns
ClaimAndStakeInventoryChanged()
Called by our holder object to let us know the inventory holding the claims and stakes has recently changed. We only care if there's a property crisis, though,
because there might be stakes/claims we need to despawn.
Declaration
public void ClaimAndStakeInventoryChanged()
DesiredSettlementClaims()
Declaration
public int DesiredSettlementClaims()
Returns
Type |
Description |
System.Int32 |
|
DesiredStakes()
Declaration
public int DesiredStakes()
Returns
Type |
Description |
System.Int32 |
|
DesiredSupportClaims()
Declaration
public int DesiredSupportClaims()
Returns
Type |
Description |
System.Int32 |
|
Destroy()
Declaration
GlobalCrisisNotice()
Declaration
public LocString GlobalCrisisNotice()
Returns
Initialize(Settlement)
Declaration
public void Initialize(Settlement settlement)
Parameters
RegisterExternalClaimSpawns(SpawnedClaims)
Some things can spawn claim stakes outside our normal processes, like annexing a settlement. This will increment the stakes and claims, perhaps even past the maximum, which may invoke a crisis/
Declaration
public void RegisterExternalClaimSpawns(SpawnedClaims spawned)
Parameters
ResolvePropertyCrisis(Nullable<LocString>, Boolean)
Declaration
public void ResolvePropertyCrisis(Nullable<LocString> overrideReason = null, bool notify = true)
Parameters
Type |
Name |
Description |
System.Nullable<LocString> |
overrideReason |
|
System.Boolean |
notify |
|
SynchronizeClaims(Boolean)
Given current population and current number of spawned papers and stakes, we make sure to spawn or despawn claim papers/stakes until they are synchronized with the counters.
Declaration
public bool SynchronizeClaims(bool forceRecountAllPapersAndStakes = false)
Parameters
Type |
Name |
Description |
System.Boolean |
forceRecountAllPapersAndStakes |
|
Returns
Type |
Description |
System.Boolean |
|
Tick()
Declaration
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
Description |
System.ComponentModel.PropertyChangedEventHandler |
|
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods