Show / Hide Table of Contents

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
IThreadSafeSubscriptions
ISubscriptions<ThreadSafeSubscriptions>
ISubscriptions
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged
Namespace: Eco.Gameplay.Settlements
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
Type Description
ThreadSafeAction

PropertyCrisisChangedEvent

Declaration
public ThreadSafeAction<bool> PropertyCrisisChangedEvent
Field Value
Type Description
ThreadSafeAction<System.Boolean>

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
Type Description
SpawnedClaims

SpawnOrDespawnClaims

Declaration
public SettlementProperty.ChangeInventoryEvent SpawnOrDespawnClaims { get; set; }
Property Value
Type Description
SettlementProperty.ChangeInventoryEvent

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
Type Description
ControllerList<SettlementClaimStakeObject>

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
Type Description
ThreadSafeSubscriptions

Methods

BuildCrisisMailNotice(LocString)

Declaration
public LocString BuildCrisisMailNotice(LocString destinationDesc)
Parameters
Type Name Description
LocString destinationDesc
Returns
Type Description
LocString

BuildCrisisNotice(LocString)

Creates a crisis notice for the current time. destinationDescA description of where to return the stakes and claims.

Declaration
public LocString BuildCrisisNotice(LocString destinationDesc)
Parameters
Type Name Description
LocString destinationDesc
Returns
Type Description
LocString

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
public void Destroy()

GlobalCrisisNotice()

Declaration
public LocString GlobalCrisisNotice()
Returns
Type Description
LocString

Initialize(Settlement)

Declaration
public void Initialize(Settlement settlement)
Parameters
Type Name Description
Settlement settlement

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
Type Name Description
SpawnedClaims spawned

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
public void Tick()

Events

PropertyChanged

Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type Description
System.ComponentModel.PropertyChangedEventHandler

Implements

IThreadSafeSubscriptions
ISubscriptions<TSubscriptionsList>
ISubscriptions
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾