Table of Contents

Class Settlement

Namespace
TaleWorlds.CampaignSystem.Settlements
Assembly
TaleWorlds.CampaignSystem.dll
public sealed class Settlement : MBObjectBase, IMapPoint, ITrackableCampaignObject, ITrackableBase, ISiegeEventSide, IMapEntity, IRandomOwner
Inheritance
Settlement
Implements
Inherited Members
Extension Methods

Constructors

Settlement()

public Settlement()

Settlement(TextObject, LocationComplex, PartyTemplateObject)

public Settlement(TextObject name, LocationComplex locationComplex, PartyTemplateObject pt)

Parameters

name TextObject
locationComplex LocationComplex
pt PartyTemplateObject

Fields

CanBeClaimed

[SaveableField(104)]
public int CanBeClaimed

Field Value

int

ClaimValue

[SaveableField(105)]
public float ClaimValue

Field Value

float

ClaimedBy

[SaveableField(106)]
public Hero ClaimedBy

Field Value

Hero

Culture

public CultureObject Culture

Field Value

CultureObject

HasVisited

[SaveableField(107)]
public bool HasVisited

Field Value

bool

Hideout

public Hideout Hideout

Field Value

Hideout

LastVisitTimeOfOwner

[SaveableField(110)]
public float LastVisitTimeOfOwner

Field Value

float

MilitiaPartyComponent

[CachedData]
public MilitiaPartyComponent MilitiaPartyComponent

Field Value

MilitiaPartyComponent

NumberOfLordPartiesTargeting

[SaveableField(102)]
public int NumberOfLordPartiesTargeting

Field Value

int

Stash

[SaveableField(145)]
public readonly ItemRoster Stash

Field Value

ItemRoster

Town

public Town Town

Field Value

Town

Village

public Village Village

Field Value

Village

Properties

All

public static MBReadOnlyList<Settlement> All { get; }

Property Value

MBReadOnlyList<Settlement>

Alleys

[SaveableProperty(133)]
public List<Alley> Alleys { get; }

Property Value

List<Alley>

BattleSide

public BattleSideEnum BattleSide { get; }

Property Value

BattleSideEnum

BoundVillages

public MBReadOnlyList<Village> BoundVillages { get; }

Property Value

MBReadOnlyList<Village>

BribePaid

[SaveableProperty(116)]
public int BribePaid { get; set; }

Property Value

int

CurrentNavigationFace

public PathFaceRecord CurrentNavigationFace { get; }

Property Value

PathFaceRecord

CurrentSettlement

public static Settlement CurrentSettlement { get; }

Property Value

Settlement

CurrentSiegeState

[SaveableProperty(142)]
public Settlement.SiegeState CurrentSiegeState { get; }

Property Value

Settlement.SiegeState
public string EncyclopediaLink { get; }

Property Value

string

EncyclopediaLinkWithName

public TextObject EncyclopediaLinkWithName { get; }

Property Value

TextObject

EncyclopediaText

public TextObject EncyclopediaText { get; }

Property Value

TextObject

GarrisonWagePaymentLimit

[SaveableProperty(122)]
public int GarrisonWagePaymentLimit { get; }

Property Value

int

GatePosition

public Vec2 GatePosition { get; }

Property Value

Vec2

GetFirst

public static Settlement GetFirst { get; }

Property Value

Settlement

GetPosition2D

public Vec2 GetPosition2D { get; }

Property Value

Vec2

HeroesWithoutParty

public MBReadOnlyList<Hero> HeroesWithoutParty { get; }

Property Value

MBReadOnlyList<Hero>

InRebelliousState

public bool InRebelliousState { get; }

Property Value

bool

IsActive

[SaveableProperty(112)]
public bool IsActive { get; set; }

Property Value

bool

IsAlerted

public bool IsAlerted { get; }

Property Value

bool

IsCastle

public bool IsCastle { get; }

Property Value

bool

IsFortification

public bool IsFortification { get; }

Property Value

bool

IsHideout

public bool IsHideout { get; }

Property Value

bool

IsInspected

[CachedData]
public bool IsInspected { get; set; }

Property Value

bool

IsRaided

public bool IsRaided { get; }

Property Value

bool

IsStarving

public bool IsStarving { get; }

Property Value

bool

IsTown

public bool IsTown { get; }

Property Value

bool

IsUnderRaid

public bool IsUnderRaid { get; }

Property Value

bool

IsUnderSiege

public bool IsUnderSiege { get; }

Property Value

bool

IsVillage

public bool IsVillage { get; }

Property Value

bool

IsVisible

public bool IsVisible { get; set; }

Property Value

bool

ItemRoster

public ItemRoster ItemRoster { get; }

Property Value

ItemRoster

LastAttackerParty

public MobileParty LastAttackerParty { get; set; }

Property Value

MobileParty

LastThreatTime

[SaveableProperty(137)]
public CampaignTime LastThreatTime { get; }

Property Value

CampaignTime

LocationComplex

[SaveableProperty(138)]
public LocationComplex LocationComplex { get; }

Property Value

LocationComplex

MapFaction

public IFaction MapFaction { get; }

Property Value

IFaction

MaxHitPointsOfOneWallSection

public float MaxHitPointsOfOneWallSection { get; }

Property Value

float

MaxWallHitPoints

public float MaxWallHitPoints { get; }

Property Value

float

Militia

public float Militia { get; set; }

Property Value

float

Name

public TextObject Name { get; set; }

Property Value

TextObject

Notables

public MBReadOnlyList<Hero> Notables { get; }

Property Value

MBReadOnlyList<Hero>

NumberOfAlliesSpottedAround

[SaveableProperty(128)]
public float NumberOfAlliesSpottedAround { get; set; }

Property Value

float

NumberOfEnemiesSpottedAround

[SaveableProperty(115)]
public float NumberOfEnemiesSpottedAround { get; set; }

Property Value

float

NumberOfLordPartiesAt

public int NumberOfLordPartiesAt { get; }

Property Value

int

NumberOfTroopsKilledOnSide

[SaveableProperty(150)]
public int NumberOfTroopsKilledOnSide { get; }

Property Value

int

Owner

public Hero Owner { get; }

Property Value

Hero

OwnerClan

public Clan OwnerClan { get; }

Property Value

Clan

Parties

public MBReadOnlyList<MobileParty> Parties { get; }

Property Value

MBReadOnlyList<MobileParty>

Party

[SaveableProperty(101)]
public PartyBase Party { get; }

Property Value

PartyBase

Position2D

public Vec2 Position2D { get; }

Property Value

Vec2

RandomValue

public int RandomValue { get; }

Property Value

int

SettlementComponent

[SaveableProperty(152)]
public SettlementComponent SettlementComponent { get; }

Property Value

SettlementComponent

SettlementHitPoints

[SaveableProperty(121)]
public float SettlementHitPoints { get; }

Property Value

float

SettlementTotalWallHitPoints

public float SettlementTotalWallHitPoints { get; }

Property Value

float

SettlementWallSectionHitPointsRatioList

public MBReadOnlyList<float> SettlementWallSectionHitPointsRatioList { get; }

Property Value

MBReadOnlyList<float>

SiegeEngineMissiles

public MBReadOnlyList<SiegeEvent.SiegeEngineMissile> SiegeEngineMissiles { get; }

Property Value

MBReadOnlyList<SiegeEvent.SiegeEngineMissile>

SiegeEngines

[SaveableProperty(149)]
public SiegeEvent.SiegeEnginesContainer SiegeEngines { get; }

Property Value

SiegeEvent.SiegeEnginesContainer

SiegeEvent

[SaveableProperty(111)]
public SiegeEvent SiegeEvent { get; set; }

Property Value

SiegeEvent

SiegeStrategy

[SaveableProperty(151)]
public SiegeStrategy SiegeStrategy { get; }

Property Value

SiegeStrategy

WallSectionCount

public int WallSectionCount { get; }

Property Value

int

Methods

AddGarrisonParty(bool)

public void AddGarrisonParty(bool addInitialGarrison = false)

Parameters

addInitialGarrison bool

AddSiegeEngineMissile(SiegeEngineMissile)

public void AddSiegeEngineMissile(SiegeEvent.SiegeEngineMissile missile)

Parameters

missile SiegeEvent.SiegeEngineMissile

AfterLoad()

protected override void AfterLoad()

AutoGeneratedInstanceCollectObjects(List<object>)

protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)

Parameters

collectedObjects List<object>

CheckTracked(BasicCharacterObject)

public bool CheckTracked(BasicCharacterObject basicCharacter)

Parameters

basicCharacter BasicCharacterObject

Returns

bool

Deserialize(MBObjectManager, XmlNode)

public override void Deserialize(MBObjectManager objectManager, XmlNode node)

Parameters

objectManager MBObjectManager
node XmlNode

FinalizeSiegeEvent()

public void FinalizeSiegeEvent()

Find(string)

public static Settlement Find(string idString)

Parameters

idString string

Returns

Settlement

FindAll(Func<Settlement, bool>)

public static IEnumerable<Settlement> FindAll(Func<Settlement, bool> predicate)

Parameters

predicate Func<Settlement, bool>

Returns

IEnumerable<Settlement>

FindFirst(Func<Settlement, bool>)

public static Settlement FindFirst(Func<Settlement, bool> predicate)

Parameters

predicate Func<Settlement, bool>

Returns

Settlement

FindNextLocatable(ref LocatableSearchData<Settlement>)

public static Settlement FindNextLocatable(ref LocatableSearchData<Settlement> data)

Parameters

data LocatableSearchData<Settlement>

Returns

Settlement

GetAttackTarget(ISiegeEventSide, SiegeEngineType, int, out SiegeBombardTargets, out int)

public void GetAttackTarget(ISiegeEventSide siegeEventSide, SiegeEngineType siegeEngine, int siegeEngineSlot, out SiegeBombardTargets targetType, out int targetIndex)

Parameters

siegeEventSide ISiegeEventSide
siegeEngine SiegeEngineType
siegeEngineSlot int
targetType SiegeBombardTargets
targetIndex int

GetInvolvedPartiesForEventType(BattleTypes)

public IEnumerable<PartyBase> GetInvolvedPartiesForEventType(MapEvent.BattleTypes mapEventType = BattleTypes.Siege)

Parameters

mapEventType MapEvent.BattleTypes

Returns

IEnumerable<PartyBase>

GetLogicalPosition()

public Vec3 GetLogicalPosition()

Returns

Vec3

GetMountAndHarnessVisualIdsForPartyIcon(out string, out string)

public void GetMountAndHarnessVisualIdsForPartyIcon(out string mountStringId, out string harnessStringId)

Parameters

mountStringId string
harnessStringId string

GetName()

public override TextObject GetName()

Returns

TextObject

GetNextInvolvedPartyForEventType(ref int, BattleTypes)

public PartyBase GetNextInvolvedPartyForEventType(ref int partyIndex, MapEvent.BattleTypes mapEventType = BattleTypes.Siege)

Parameters

partyIndex int
mapEventType MapEvent.BattleTypes

Returns

PartyBase

GetPosition()

public Vec3 GetPosition()

Returns

Vec3

GetSettlementValueForEnemyHero(Hero)

public float GetSettlementValueForEnemyHero(Hero hero)

Parameters

hero Hero

Returns

float

GetSettlementValueForFaction(IFaction)

public float GetSettlementValueForFaction(IFaction faction)

Parameters

faction IFaction

Returns

float

GetTrackDistanceToMainAgent()

public float GetTrackDistanceToMainAgent()

Returns

float

GetValue(Hero, bool)

public float GetValue(Hero hero = null, bool countAlsoBoundedSettlements = true)

Parameters

hero Hero
countAlsoBoundedSettlements bool

Returns

float

HasInvolvedPartyForEventType(PartyBase, BattleTypes)

public bool HasInvolvedPartyForEventType(PartyBase party, MapEvent.BattleTypes mapEventType = BattleTypes.Siege)

Parameters

party PartyBase
mapEventType MapEvent.BattleTypes

Returns

bool

InitializeSiegeEventSide()

public void InitializeSiegeEventSide()

IsUnderRebellionAttack()

public bool IsUnderRebellionAttack()

Returns

bool

OnFinishLoadState()

public void OnFinishLoadState()

OnGameCreated()

public void OnGameCreated()

OnGameInitialized()

public void OnGameInitialized()

OnPartyInteraction(MobileParty)

public void OnPartyInteraction(MobileParty mobileParty)

Parameters

mobileParty MobileParty

OnPlayerEncounterFinish()

public void OnPlayerEncounterFinish()

OnSessionStart()

public void OnSessionStart()

OnTroopsKilledOnSide(int)

public void OnTroopsKilledOnSide(int killCount)

Parameters

killCount int

RemoveDeprecatedMissiles()

public void RemoveDeprecatedMissiles()

ResetSiegeState()

public void ResetSiegeState()

SetGarrisonWagePaymentLimit(int)

public void SetGarrisonWagePaymentLimit(int limit)

Parameters

limit int

SetNextSiegeState()

public void SetNextSiegeState()

SetSettlementComponent(SettlementComponent)

public void SetSettlementComponent(SettlementComponent settlementComponent)

Parameters

settlementComponent SettlementComponent

SetSiegeStrategy(SiegeStrategy)

public void SetSiegeStrategy(SiegeStrategy strategy)

Parameters

strategy SiegeStrategy

SetWallSectionHitPointsRatioAtIndex(int, float)

public void SetWallSectionHitPointsRatioAtIndex(int index, float hitPointsRatio)

Parameters

index int
hitPointsRatio float

StartFindingLocatablesAroundPosition(Vec2, float)

public static LocatableSearchData<Settlement> StartFindingLocatablesAroundPosition(Vec2 position, float radius)

Parameters

position Vec2
radius float

Returns

LocatableSearchData<Settlement>

ToString()

public override string ToString()

Returns

string

This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).