Class TroopRoster
- Namespace
- TaleWorlds.CampaignSystem.Roster
- Assembly
- TaleWorlds.CampaignSystem.dll
public class TroopRoster : ISerializableObject
- Inheritance
-
TroopRoster
- Implements
- Inherited Members
Constructors
TroopRoster(PartyBase)
public TroopRoster(PartyBase ownerParty)
Parameters
ownerParty
PartyBase
Properties
Count
public int Count { get; }
Property Value
IsPrisonRoster
public bool IsPrisonRoster { get; set; }
Property Value
TotalHealthyCount
public int TotalHealthyCount { get; }
Property Value
TotalHeroes
public int TotalHeroes { get; }
Property Value
TotalManCount
public int TotalManCount { get; }
Property Value
TotalRegulars
public int TotalRegulars { get; }
Property Value
TotalWounded
public int TotalWounded { get; }
Property Value
TotalWoundedHeroes
public int TotalWoundedHeroes { get; }
Property Value
TotalWoundedRegulars
public int TotalWoundedRegulars { get; }
Property Value
VersionNo
[CachedData]
public int VersionNo { get; }
Property Value
Methods
Add(IEnumerable<FlattenedTroopRosterElement>)
public void Add(IEnumerable<FlattenedTroopRosterElement> elementList)
Parameters
elementList
IEnumerable<FlattenedTroopRosterElement>
Add(TroopRoster)
public void Add(TroopRoster troopRoster)
Parameters
troopRoster
TroopRoster
Add(TroopRosterElement)
public void Add(TroopRosterElement troopRosterElement)
Parameters
troopRosterElement
TroopRosterElement
AddToCounts(CharacterObject, int, bool, int, int, bool, int)
public int AddToCounts(CharacterObject character, int count, bool insertAtFront = false, int woundedCount = 0, int xpChange = 0, bool removeDepleted = true, int index = -1)
Parameters
character
CharacterObjectcount
intinsertAtFront
boolwoundedCount
intxpChange
intremoveDepleted
boolindex
int
Returns
AddToCountsAtIndex(int, int, int, int, bool)
public int AddToCountsAtIndex(int index, int countChange, int woundedCountChange = 0, int xpChange = 0, bool removeDepleted = true)
Parameters
Returns
AddXpToTroop(int, CharacterObject)
public int AddXpToTroop(int xpAmount, CharacterObject attackerTroop)
Parameters
xpAmount
intattackerTroop
CharacterObject
Returns
AddXpToTroopAtIndex(int, int)
public int AddXpToTroopAtIndex(int xpAmount, int index)
Parameters
Returns
AutoGeneratedInstanceCollectObjects(List<object>)
protected virtual void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
Parameters
CalculateCachedStatsOnLoad()
public static void CalculateCachedStatsOnLoad()
CheckValidity()
[Conditional("DEBUG_MORE")]
public void CheckValidity()
Clear()
public void Clear()
ClearTempXp()
public void ClearTempXp()
CloneRosterData()
public TroopRoster CloneRosterData()
Returns
Contains(CharacterObject)
public bool Contains(CharacterObject character)
Parameters
character
CharacterObject
Returns
CreateDummyTroopRoster()
public static TroopRoster CreateDummyTroopRoster()
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
FillMembersOfRoster(int, CharacterObject)
public void FillMembersOfRoster(int neededNumber, CharacterObject basicTroop = null)
Parameters
neededNumber
intbasicTroop
CharacterObject
FindIndexOfTroop(CharacterObject)
public int FindIndexOfTroop(CharacterObject character)
Parameters
character
CharacterObject
Returns
GetCharacterAtIndex(int)
public CharacterObject GetCharacterAtIndex(int index)
Parameters
index
int
Returns
GetElementCopyAtIndex(int)
public TroopRosterElement GetElementCopyAtIndex(int index)
Parameters
index
int
Returns
GetElementNumber(int)
public int GetElementNumber(int index)
Parameters
index
int
Returns
GetElementNumber(CharacterObject)
public int GetElementNumber(CharacterObject character)
Parameters
character
CharacterObject
Returns
GetElementWoundedNumber(int)
public int GetElementWoundedNumber(int index)
Parameters
index
int
Returns
GetElementXp(int)
public int GetElementXp(int index)
Parameters
index
int
Returns
GetElementXp(CharacterObject)
public int GetElementXp(CharacterObject character)
Parameters
character
CharacterObject
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetManAtIndexFromFlattenedRosterWithFilter(int, bool, bool)
public CharacterObject GetManAtIndexFromFlattenedRosterWithFilter(int indexOfTroop, bool includeHeroes = false, bool countOnlyHealthyOnes = false)
Parameters
Returns
GetTroopCount(CharacterObject)
public int GetTroopCount(CharacterObject troop)
Parameters
troop
CharacterObject
Returns
GetTroopRoster()
public MBList<TroopRosterElement> GetTroopRoster()
Returns
KillNumberOfNonHeroTroopsRandomly(int)
public void KillNumberOfNonHeroTroopsRandomly(int numberOfMen)
Parameters
numberOfMen
int
OnHeroHealthStatusChanged(Hero)
public void OnHeroHealthStatusChanged(Hero hero)
Parameters
hero
Hero
RemoveIf(Predicate<TroopRosterElement>)
public ICollection<TroopRosterElement> RemoveIf(Predicate<TroopRosterElement> match)
Parameters
match
Predicate<TroopRosterElement>
Returns
RemoveTroop(CharacterObject, int, UniqueTroopDescriptor, int)
public void RemoveTroop(CharacterObject troop, int numberToRemove = 1, UniqueTroopDescriptor troopSeed = default, int xp = 0)
Parameters
troop
CharacterObjectnumberToRemove
inttroopSeed
UniqueTroopDescriptorxp
int
RemoveZeroCounts()
public void RemoveZeroCounts()
Reset()
public void Reset()
SetElementNumber(int, int)
public void SetElementNumber(int index, int number)
Parameters
SetElementWoundedNumber(int, int)
public void SetElementWoundedNumber(int index, int number)
Parameters
SetElementXp(int, int)
public void SetElementXp(int index, int number)
Parameters
ShiftTroopToIndex(int, int)
public void ShiftTroopToIndex(int troopIndex, int targetIndex)
Parameters
Sum(Func<TroopRosterElement, int>)
public int Sum(Func<TroopRosterElement, int> selector)
Parameters
selector
Func<TroopRosterElement, int>
Returns
SwapTroopsAtIndices(int, int)
public void SwapTroopsAtIndices(int firstIndex, int secondIndex)
Parameters
ToFlattenedRoster()
public FlattenedTroopRoster ToFlattenedRoster()
Returns
UpdateVersion()
public void UpdateVersion()
ValidateTroopListCache()
public void ValidateTroopListCache()
WoundMembersOfRoster(float)
public void WoundMembersOfRoster(float woundedRatio)
Parameters
woundedRatio
float
WoundNumberOfTroopsRandomly(int)
public void WoundNumberOfTroopsRandomly(int numberOfMen)
Parameters
numberOfMen
int
WoundTroop(CharacterObject, int, UniqueTroopDescriptor)
public void WoundTroop(CharacterObject troop, int numberToWound = 1, UniqueTroopDescriptor troopSeed = default)
Parameters
troop
CharacterObjectnumberToWound
inttroopSeed
UniqueTroopDescriptor
Operators
operator ==(TroopRoster, TroopRoster)
public static bool operator ==(TroopRoster a, TroopRoster b)
Parameters
Returns
operator !=(TroopRoster, TroopRoster)
public static bool operator !=(TroopRoster a, TroopRoster b)
Parameters
Returns
This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).