M&B: Bannerlord 1.0.0
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.MountAndBlade.MBExtensions Class Reference

Extension methods for common usage

Static Public Member Functions

static Vec2 GetGlobalOrganicDirection (this ColumnFormation columnFormation)
 
static Vec2 GetGlobalHeadDirection (this ColumnFormation columnFormation)
 
static IEnumerable< T > FindAllWithType< T > (this IEnumerable< GameEntity > entities)
 Returns all script components with the specified type. More...
 
static IEnumerable< T > FindAllWithType< T > (this IEnumerable< MissionObject > missionObjects)
 
static List< GameEntityFindAllWithCompatibleType (this IEnumerable< GameEntity > sceneProps, params Type[] types)
 Returns all game entities which are compatible with the specified types. More...
 
static List< MissionObjectFindAllWithCompatibleType (this IEnumerable< MissionObject > missionObjects, params Type[] types)
 
static List< T > CollectObjects< T > (this GameEntity entity)
 Collects all objects with type from scripted components of this entity and its children. More...
 
static List< T > CollectObjectsWithTag< T > (this GameEntity entity, string tag)
 Collects all objects with type from scripted components of this entity with the given tag. More...
 
static List< GameEntityCollectChildrenEntitiesWithTag (this GameEntity entity, string tag)
 
static GameEntity GetFirstChildEntityWithTag (this GameEntity entity, string tag)
 
static T GetFirstScriptInFamilyDescending< T > (this GameEntity entity)
 
static bool HasParentOfType (this GameEntity e, Type t)
 
static TSource ElementAtOrValue< TSource > (this IEnumerable< TSource > source, int index, TSource value)
 
static bool IsOpponentOf (this BattleSideEnum s, BattleSideEnum side)
 

Member Function Documentation

◆ GetGlobalOrganicDirection()

static Vec2 TaleWorlds.MountAndBlade.MBExtensions.GetGlobalOrganicDirection ( this ColumnFormation  columnFormation)
static

◆ GetGlobalHeadDirection()

static Vec2 TaleWorlds.MountAndBlade.MBExtensions.GetGlobalHeadDirection ( this ColumnFormation  columnFormation)
static

◆ FindAllWithType< T >() [1/2]

static IEnumerable< T > TaleWorlds.MountAndBlade.MBExtensions.FindAllWithType< T > ( this IEnumerable< GameEntity entities)
static
Template Parameters
TType of the requested script components.
Parameters
entities
Returns
List of script components with specified type.
Type Constraints
T :ScriptComponentBehavior 

◆ FindAllWithType< T >() [2/2]

static IEnumerable< T > TaleWorlds.MountAndBlade.MBExtensions.FindAllWithType< T > ( this IEnumerable< MissionObject missionObjects)
static
Type Constraints
T :MissionObject 

◆ FindAllWithCompatibleType() [1/2]

static List< GameEntity > TaleWorlds.MountAndBlade.MBExtensions.FindAllWithCompatibleType ( this IEnumerable< GameEntity sceneProps,
params Type[]  types 
)
static
Parameters
sceneProps
typesCompatible types of the requested scene props.
Returns
List of scene props which are compatible with the specified types.

◆ FindAllWithCompatibleType() [2/2]

static List< MissionObject > TaleWorlds.MountAndBlade.MBExtensions.FindAllWithCompatibleType ( this IEnumerable< MissionObject missionObjects,
params Type[]  types 
)
static

◆ CollectObjects< T >()

static List< T > TaleWorlds.MountAndBlade.MBExtensions.CollectObjects< T > ( this GameEntity  entity)
static
Template Parameters
TThe type of objects to be collected.
Parameters
entityThe root entity from which the objects will be collected from.
Returns
Returns collected objects.
Type Constraints
T :ScriptComponentBehavior 

◆ CollectObjectsWithTag< T >()

static List< T > TaleWorlds.MountAndBlade.MBExtensions.CollectObjectsWithTag< T > ( this GameEntity  entity,
string  tag 
)
static
Template Parameters
TThe type of objects to be collected.
Parameters
entityThe root entity from which the objects will be collected from.
tagTag that is required on the child.
Returns
Returns collected objects.
Type Constraints
T :ScriptComponentBehavior 

◆ CollectChildrenEntitiesWithTag()

static List< GameEntity > TaleWorlds.MountAndBlade.MBExtensions.CollectChildrenEntitiesWithTag ( this GameEntity  entity,
string  tag 
)
static

◆ GetFirstChildEntityWithTag()

static GameEntity TaleWorlds.MountAndBlade.MBExtensions.GetFirstChildEntityWithTag ( this GameEntity  entity,
string  tag 
)
static

◆ GetFirstScriptInFamilyDescending< T >()

static T TaleWorlds.MountAndBlade.MBExtensions.GetFirstScriptInFamilyDescending< T > ( this GameEntity  entity)
static
Type Constraints
T :ScriptComponentBehavior 

◆ HasParentOfType()

static bool TaleWorlds.MountAndBlade.MBExtensions.HasParentOfType ( this GameEntity  e,
Type  t 
)
static

◆ ElementAtOrValue< TSource >()

static TSource TaleWorlds.MountAndBlade.MBExtensions.ElementAtOrValue< TSource > ( this IEnumerable< TSource >  source,
int  index,
TSource  value 
)
static

◆ IsOpponentOf()

static bool TaleWorlds.MountAndBlade.MBExtensions.IsOpponentOf ( this BattleSideEnum  s,
BattleSideEnum  side 
)
static