M&B: Bannerlord 1.1.0
The horns sound, the ravens gather.
|
Inherits TaleWorlds.MountAndBlade.IFormation.
Public Member Functions | |
Formation (Team team, int index) | |
WorldPosition | CreateNewOrderWorldPosition (WorldPosition.WorldPositionEnforcedCache worldPositionEnforcedCache) |
Creates new world position from the order position. Warning: this reduces the efficiency of world position ground height caching. Avoid using this if possible. | |
void | SetMovementOrder (MovementOrder input) |
void | SetControlledByAI (bool isControlledByAI, bool enforceNotSplittableByAI=false) |
Sets if formation is controlled by the AI. | |
void | ResetArrangementOrderTickTimer () |
void | SetPositioning (WorldPosition? position=null, Vec2? direction=null, int? unitSpacing=null) |
int | GetCountOfUnitsWithCondition (Func< Agent, bool > function) |
ref readonly MovementOrder | GetReadonlyMovementOrderReference () |
Don't try to use returned value to call member functions of it that changes the returned value. It will be compiled but actual _movementOrder variable will not be changed after the call. | |
Agent | GetFirstUnit () |
int | GetCountOfUnitsInClass (FormationClass formationClass, bool excludeBannerBearer) |
void | SetSpawnIndex (int value=0) |
int | GetNextSpawnIndex () |
Agent | GetUnitWithIndex (int unitIndex) |
Vec2 | GetAveragePositionOfUnits (bool excludeDetachedUnits, bool excludePlayer) |
Agent | GetMedianAgent (bool excludeDetachedUnits, bool excludePlayer, Vec2 averagePosition) |
Agent.UnderAttackType | GetUnderAttackTypeOfUnits (float timeLimit=3.0f) |
Agent.MovementBehaviorType | GetMovementTypeOfUnits () |
IEnumerable< Agent > | GetUnitsWithoutDetachedOnes () |
Vec2 | GetWallDirectionOfRelativeFormationLocation (Agent unit) |
Vec2 | GetDirectionOfUnit (Agent unit) |
WorldPosition | GetOrderPositionOfUnit (Agent unit) |
Vec2 | GetCurrentGlobalPositionOfUnit (Agent unit, bool blendWithOrderDirection) |
float | GetAverageMaximumMovementSpeedOfUnits () |
float | GetMovementSpeedOfUnits () |
float | GetFormationPower () |
float | GetFormationMeleeFightingPower () |
IDetachment | GetDetachmentOrDefault (Agent agent) |
WorldFrame? | GetDetachmentFrame (Agent agent) |
Vec2 | GetMiddleFrontUnitPositionOffset () |
List< IFormationUnit > | GetUnitsToPopWithReferencePosition (int count, Vec3 targetPosition) |
List< IFormationUnit > | GetUnitsToPop (int count) |
IEnumerable< ValueTuple< WorldPosition, Vec2 > > | GetUnavailableUnitPositionsAccordingToNewOrder (Formation simulationFormation, in WorldPosition position, in Vec2 direction, float width, int unitSpacing) |
void | GetUnitSpawnFrameWithIndex (int unitIndex, in WorldPosition formationPosition, in Vec2 formationDirection, float width, int unitCount, int unitSpacing, bool isMountedFormation, out WorldPosition? unitSpawnPosition, out Vec2? unitSpawnDirection) |
void | GetUnitPositionWithIndexAccordingToNewOrder (Formation simulationFormation, int unitIndex, in WorldPosition formationPosition, in Vec2 formationDirection, float width, int unitSpacing, out WorldPosition? unitSpawnPosition, out Vec2? unitSpawnDirection) |
void | GetUnitPositionWithIndexAccordingToNewOrder (Formation simulationFormation, int unitIndex, in WorldPosition formationPosition, in Vec2 formationDirection, float width, int unitSpacing, int overridenUnitCount, out WorldPosition? unitPosition, out Vec2? unitDirection) |
void | GetUnitPositionWithIndexAccordingToNewOrder (Formation simulationFormation, int unitIndex, in WorldPosition formationPosition, in Vec2 formationDirection, float width, int unitSpacing, out WorldPosition? unitSpawnPosition, out Vec2? unitSpawnDirection, out float actualWidth) |
bool | HasUnitsWithCondition (Func< Agent, bool > function) |
bool | HasUnitsWithCondition (Func< Agent, bool > function, out Agent result) |
bool | HasAnyEnemyFormationsThatIsNotEmpty () |
bool | HasUnitWithConditionLimitedRandom (Func< Agent, bool > function, int startingIndex, int willBeCheckedUnitCount, out Agent resultAgent) |
Prioritizes attached agents. | |
int[] | CollectUnitIndices () |
void | ApplyActionOnEachUnit (Action< Agent > action, Agent ignoreAgent=null) |
void | ApplyActionOnEachAttachedUnit (Action< Agent > action) |
void | ApplyActionOnEachDetachedUnit (Action< Agent > action) |
void | ApplyActionOnEachUnitViaBackupList (Action< Agent > action) |
void | ApplyActionOnEachUnit (Action< Agent, List< WorldPosition > > action, List< WorldPosition > list) |
int | CountUnitsOnNavMeshIDMod10 (int navMeshID, bool includeOnlyPositionedUnits) |
void | OnAgentControllerChanged (Agent agent, Agent.ControllerType oldController) |
void | OnMassUnitTransferStart () |
void | OnMassUnitTransferEnd () |
void | OnBatchUnitRemovalStart () |
void | OnBatchUnitRemovalEnd () |
void | OnUnitAddedOrRemoved () |
void | OnAgentLostMount (Agent agent) |
void | OnFormationDispersed () |
void | OnUnitDetachmentChanged (Agent unit, bool isOldDetachmentLoose, bool isNewDetachmentLoose) |
void | OnUndetachableNonPlayerUnitAdded (Agent unit) |
void | OnUndetachableNonPlayerUnitRemoved (Agent unit) |
void | ReleaseFormationFromAI () |
void | ResetMovementOrderPositionCache () |
void | Reset () |
IEnumerable< Formation > | Split (int count=2) |
void | TransferUnits (Formation target, int unitCount) |
void | TransferUnitsAux (Formation target, int unitCount, bool isPlayerOrder, bool useSelectivePop) |
DO NOT USE THIS METHOD. | |
void | DebugArrangements () |
void | AddUnit (Agent unit) |
void | RemoveUnit (Agent unit) |
void | DetachUnit (Agent unit, bool isLoose) |
void | AttachUnit (Agent unit) |
void | SwitchUnitLocations (Agent firstUnit, Agent secondUnit) |
void | Tick (float dt) |
void | JoinDetachment (IDetachment detachment) |
void | FormAttackEntityDetachment (GameEntity targetEntity) |
void | LeaveDetachment (IDetachment detachment) |
void | DisbandAttackEntityDetachment () |
void | Rearrange (IFormationArrangement arrangement) |
void | TickForColumnArrangementInitialPositioning (Formation formation) |
float | CalculateFormationDirectionEnforcingFactorForRank (int rankIndex) |
void | BeginSpawn (int unitCount, bool isMounted) |
void | EndSpawn () |
override int | GetHashCode () |
bool | GetIsLocalPositionAvailable (Vec2 localPosition, Vec2? nearestAvailableUnitPositionLocal) |
Checks if position is a valid point in the scene. | |
bool | BatchUnitPositions (MBArrayList< Vec2i > orderedPositionIndices, MBArrayList< Vec2 > orderedLocalPositions, MBList2D< int > availabilityTable, MBList2D< WorldPosition > globalPositionTable, int fileCount, int rankCount) |
IFormationUnit | GetClosestUnitTo (Vec2 localPosition, MBList< IFormationUnit > unitsWithSpaces=null, float? maxDistance=null) |
IFormationUnit | GetClosestUnitTo (IFormationUnit targetUnit, MBList< IFormationUnit > unitsWithSpaces=null, float? maxDistance=null) |
void | OnUnitAddedOrRemoved () |
void | SetUnitToFollow (IFormationUnit unit, IFormationUnit toFollow, Vec2 vector) |
Static Public Member Functions | |
static float | GetLastSimulatedFormationsOccupationWidthIfLesserThanActualWidth (Formation simulationFormation) |
static List< WorldFrame > | GetFormationFramesForBeforeFormationCreation (float width, int manCount, bool areMounted, WorldPosition spawnOrigin, Mat3 spawnRotation) |
static float | GetDefaultUnitDiameter (bool isMounted) |
static float | GetDefaultMinimumInterval (bool isMounted) |
static float | GetDefaultMaximumInterval (bool isMounted) |
static float | GetDefaultMinimumDistance (bool isMounted) |
static float | GetDefaultMaximumDistance (bool isMounted) |
static float | InfantryInterval (int unitSpacing) |
static float | CavalryInterval (int unitSpacing) |
static float | InfantryDistance (int unitSpacing) |
static float | CavalryDistance (int unitSpacing) |
static bool | IsDefenseRelatedAIDrivenComponent (DrivenProperty drivenProperty) |
Public Attributes | |
readonly Team | Team |
readonly int | Index |
readonly FormationClass | FormationIndex |
Banner | Banner |
bool | HasBeenPositioned = false |
Vec2? | ReferencePosition |
Static Public Attributes | |
const float | AveragePositionCalculatePeriod = 0.05f |
const int | MinimumUnitSpacing = 0 |
const int | MaximumUnitSpacing = 2 |
TaleWorlds.MountAndBlade.Formation.Formation | ( | Team | team, |
int | index | ||
) |
team | |
index | |
isVisualOnly | Is only used by UI, no effect on game logic |
WorldPosition TaleWorlds.MountAndBlade.Formation.CreateNewOrderWorldPosition | ( | WorldPosition::WorldPositionEnforcedCache | worldPositionEnforcedCache | ) |
void TaleWorlds.MountAndBlade.Formation.SetMovementOrder | ( | MovementOrder | input | ) |
void TaleWorlds.MountAndBlade.Formation.SetControlledByAI | ( | bool | isControlledByAI, |
bool | enforceNotSplittableByAI = false |
||
) |
isControlledByAI | Determines if the formation will be controlled by the ai |
enforceNotSplittableByAI | If set ai cannot split this formation (i.e. transfer troops from this formation to others) when deciding tactics |
void TaleWorlds.MountAndBlade.Formation.ResetArrangementOrderTickTimer | ( | ) |
void TaleWorlds.MountAndBlade.Formation.SetPositioning | ( | WorldPosition? | position = null , |
Vec2? | direction = null , |
||
int? | unitSpacing = null |
||
) |
int TaleWorlds.MountAndBlade.Formation.GetCountOfUnitsWithCondition | ( | Func< Agent, bool > | function | ) |
ref readonly MovementOrder TaleWorlds.MountAndBlade.Formation.GetReadonlyMovementOrderReference | ( | ) |
Agent TaleWorlds.MountAndBlade.Formation.GetFirstUnit | ( | ) |
int TaleWorlds.MountAndBlade.Formation.GetCountOfUnitsInClass | ( | FormationClass | formationClass, |
bool | excludeBannerBearer | ||
) |
void TaleWorlds.MountAndBlade.Formation.SetSpawnIndex | ( | int | value = 0 | ) |
int TaleWorlds.MountAndBlade.Formation.GetNextSpawnIndex | ( | ) |
Agent TaleWorlds.MountAndBlade.Formation.GetUnitWithIndex | ( | int | unitIndex | ) |
Vec2 TaleWorlds.MountAndBlade.Formation.GetAveragePositionOfUnits | ( | bool | excludeDetachedUnits, |
bool | excludePlayer | ||
) |
Agent TaleWorlds.MountAndBlade.Formation.GetMedianAgent | ( | bool | excludeDetachedUnits, |
bool | excludePlayer, | ||
Vec2 | averagePosition | ||
) |
Agent.UnderAttackType TaleWorlds.MountAndBlade.Formation.GetUnderAttackTypeOfUnits | ( | float | timeLimit = 3::0f | ) |
Agent.MovementBehaviorType TaleWorlds.MountAndBlade.Formation.GetMovementTypeOfUnits | ( | ) |
IEnumerable< Agent > TaleWorlds.MountAndBlade.Formation.GetUnitsWithoutDetachedOnes | ( | ) |
WorldPosition TaleWorlds.MountAndBlade.Formation.GetOrderPositionOfUnit | ( | Agent | unit | ) |
Vec2 TaleWorlds.MountAndBlade.Formation.GetCurrentGlobalPositionOfUnit | ( | Agent | unit, |
bool | blendWithOrderDirection | ||
) |
float TaleWorlds.MountAndBlade.Formation.GetAverageMaximumMovementSpeedOfUnits | ( | ) |
float TaleWorlds.MountAndBlade.Formation.GetMovementSpeedOfUnits | ( | ) |
float TaleWorlds.MountAndBlade.Formation.GetFormationPower | ( | ) |
float TaleWorlds.MountAndBlade.Formation.GetFormationMeleeFightingPower | ( | ) |
IDetachment TaleWorlds.MountAndBlade.Formation.GetDetachmentOrDefault | ( | Agent | agent | ) |
WorldFrame? TaleWorlds.MountAndBlade.Formation.GetDetachmentFrame | ( | Agent | agent | ) |
Vec2 TaleWorlds.MountAndBlade.Formation.GetMiddleFrontUnitPositionOffset | ( | ) |
List< IFormationUnit > TaleWorlds.MountAndBlade.Formation.GetUnitsToPopWithReferencePosition | ( | int | count, |
Vec3 | targetPosition | ||
) |
List< IFormationUnit > TaleWorlds.MountAndBlade.Formation.GetUnitsToPop | ( | int | count | ) |
IEnumerable< ValueTuple< WorldPosition, Vec2 > > TaleWorlds.MountAndBlade.Formation.GetUnavailableUnitPositionsAccordingToNewOrder | ( | Formation | simulationFormation, |
in WorldPosition | position, | ||
in Vec2 | direction, | ||
float | width, | ||
int | unitSpacing | ||
) |
void TaleWorlds.MountAndBlade.Formation.GetUnitSpawnFrameWithIndex | ( | int | unitIndex, |
in WorldPosition | formationPosition, | ||
in Vec2 | formationDirection, | ||
float | width, | ||
int | unitCount, | ||
int | unitSpacing, | ||
bool | isMountedFormation, | ||
out WorldPosition? | unitSpawnPosition, | ||
out Vec2? | unitSpawnDirection | ||
) |
void TaleWorlds.MountAndBlade.Formation.GetUnitPositionWithIndexAccordingToNewOrder | ( | Formation | simulationFormation, |
int | unitIndex, | ||
in WorldPosition | formationPosition, | ||
in Vec2 | formationDirection, | ||
float | width, | ||
int | unitSpacing, | ||
out WorldPosition? | unitSpawnPosition, | ||
out Vec2? | unitSpawnDirection | ||
) |
void TaleWorlds.MountAndBlade.Formation.GetUnitPositionWithIndexAccordingToNewOrder | ( | Formation | simulationFormation, |
int | unitIndex, | ||
in WorldPosition | formationPosition, | ||
in Vec2 | formationDirection, | ||
float | width, | ||
int | unitSpacing, | ||
int | overridenUnitCount, | ||
out WorldPosition? | unitPosition, | ||
out Vec2? | unitDirection | ||
) |
void TaleWorlds.MountAndBlade.Formation.GetUnitPositionWithIndexAccordingToNewOrder | ( | Formation | simulationFormation, |
int | unitIndex, | ||
in WorldPosition | formationPosition, | ||
in Vec2 | formationDirection, | ||
float | width, | ||
int | unitSpacing, | ||
out WorldPosition? | unitSpawnPosition, | ||
out Vec2? | unitSpawnDirection, | ||
out float | actualWidth | ||
) |
bool TaleWorlds.MountAndBlade.Formation.HasUnitsWithCondition | ( | Func< Agent, bool > | function | ) |
bool TaleWorlds.MountAndBlade.Formation.HasUnitsWithCondition | ( | Func< Agent, bool > | function, |
out Agent | result | ||
) |
bool TaleWorlds.MountAndBlade.Formation.HasAnyEnemyFormationsThatIsNotEmpty | ( | ) |
bool TaleWorlds.MountAndBlade.Formation.HasUnitWithConditionLimitedRandom | ( | Func< Agent, bool > | function, |
int | startingIndex, | ||
int | willBeCheckedUnitCount, | ||
out Agent | resultAgent | ||
) |
function | |
willBeCheckedUnitCount |
int[] TaleWorlds.MountAndBlade.Formation.CollectUnitIndices | ( | ) |
void TaleWorlds.MountAndBlade.Formation.ApplyActionOnEachUnit | ( | Action< Agent > | action, |
Agent | ignoreAgent = null |
||
) |
void TaleWorlds.MountAndBlade.Formation.ApplyActionOnEachUnitViaBackupList | ( | Action< Agent > | action | ) |
void TaleWorlds.MountAndBlade.Formation.ApplyActionOnEachUnit | ( | Action< Agent, List< WorldPosition > > | action, |
List< WorldPosition > | list | ||
) |
int TaleWorlds.MountAndBlade.Formation.CountUnitsOnNavMeshIDMod10 | ( | int | navMeshID, |
bool | includeOnlyPositionedUnits | ||
) |
void TaleWorlds.MountAndBlade.Formation.OnAgentControllerChanged | ( | Agent | agent, |
Agent::ControllerType | oldController | ||
) |
void TaleWorlds.MountAndBlade.Formation.OnMassUnitTransferStart | ( | ) |
void TaleWorlds.MountAndBlade.Formation.OnMassUnitTransferEnd | ( | ) |
void TaleWorlds.MountAndBlade.Formation.OnBatchUnitRemovalStart | ( | ) |
void TaleWorlds.MountAndBlade.Formation.OnBatchUnitRemovalEnd | ( | ) |
void TaleWorlds.MountAndBlade.Formation.OnUnitAddedOrRemoved | ( | ) |
Implements TaleWorlds.MountAndBlade.IFormation.
void TaleWorlds.MountAndBlade.Formation.OnAgentLostMount | ( | Agent | agent | ) |
void TaleWorlds.MountAndBlade.Formation.OnFormationDispersed | ( | ) |
void TaleWorlds.MountAndBlade.Formation.OnUnitDetachmentChanged | ( | Agent | unit, |
bool | isOldDetachmentLoose, | ||
bool | isNewDetachmentLoose | ||
) |
void TaleWorlds.MountAndBlade.Formation.OnUndetachableNonPlayerUnitAdded | ( | Agent | unit | ) |
void TaleWorlds.MountAndBlade.Formation.OnUndetachableNonPlayerUnitRemoved | ( | Agent | unit | ) |
void TaleWorlds.MountAndBlade.Formation.ReleaseFormationFromAI | ( | ) |
void TaleWorlds.MountAndBlade.Formation.ResetMovementOrderPositionCache | ( | ) |
void TaleWorlds.MountAndBlade.Formation.Reset | ( | ) |
IEnumerable< Formation > TaleWorlds.MountAndBlade.Formation.Split | ( | int | count = 2 | ) |
void TaleWorlds.MountAndBlade.Formation.TransferUnits | ( | Formation | target, |
int | unitCount | ||
) |
void TaleWorlds.MountAndBlade.Formation.TransferUnitsAux | ( | Formation | target, |
int | unitCount, | ||
bool | isPlayerOrder, | ||
bool | useSelectivePop | ||
) |
target | |
unitCount |
void TaleWorlds.MountAndBlade.Formation.DebugArrangements | ( | ) |
void TaleWorlds.MountAndBlade.Formation.AddUnit | ( | Agent | unit | ) |
void TaleWorlds.MountAndBlade.Formation.RemoveUnit | ( | Agent | unit | ) |
void TaleWorlds.MountAndBlade.Formation.DetachUnit | ( | Agent | unit, |
bool | isLoose | ||
) |
void TaleWorlds.MountAndBlade.Formation.AttachUnit | ( | Agent | unit | ) |
void TaleWorlds.MountAndBlade.Formation.Tick | ( | float | dt | ) |
void TaleWorlds.MountAndBlade.Formation.JoinDetachment | ( | IDetachment | detachment | ) |
void TaleWorlds.MountAndBlade.Formation.FormAttackEntityDetachment | ( | GameEntity | targetEntity | ) |
void TaleWorlds.MountAndBlade.Formation.LeaveDetachment | ( | IDetachment | detachment | ) |
void TaleWorlds.MountAndBlade.Formation.DisbandAttackEntityDetachment | ( | ) |
void TaleWorlds.MountAndBlade.Formation.Rearrange | ( | IFormationArrangement | arrangement | ) |
void TaleWorlds.MountAndBlade.Formation.TickForColumnArrangementInitialPositioning | ( | Formation | formation | ) |
float TaleWorlds.MountAndBlade.Formation.CalculateFormationDirectionEnforcingFactorForRank | ( | int | rankIndex | ) |
void TaleWorlds.MountAndBlade.Formation.BeginSpawn | ( | int | unitCount, |
bool | isMounted | ||
) |
void TaleWorlds.MountAndBlade.Formation.EndSpawn | ( | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
override int TaleWorlds.MountAndBlade.Formation.GetHashCode | ( | ) |
|
static |
|
static |
|
static |
readonly Team TaleWorlds.MountAndBlade.Formation.Team |
readonly int TaleWorlds.MountAndBlade.Formation.Index |
readonly FormationClass TaleWorlds.MountAndBlade.Formation.FormationIndex |
Banner TaleWorlds.MountAndBlade.Formation.Banner |
bool TaleWorlds.MountAndBlade.Formation.HasBeenPositioned = false |
Vec2? TaleWorlds.MountAndBlade.Formation.ReferencePosition |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
get |
|
get |
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
|
get |
|
getset |
|
get |
|
get |
|
getset |
|
getset |
|
getset |
|
getset |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
|
get |
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
|
get |
|
getset |
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
|
get |
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
|
get |
Implements TaleWorlds.MountAndBlade.IFormation.
Action<Formation, MovementOrder.MovementOrderEnum> TaleWorlds.MountAndBlade.Formation.OnBeforeMovementOrderApplied |
Action<Formation, ArrangementOrder.ArrangementOrderEnum> TaleWorlds.MountAndBlade.Formation.OnAfterArrangementOrderApplied |