Barotrauma Client Doc
Barotrauma.AnimationParams Class Referenceabstract
Inheritance diagram for Barotrauma.AnimationParams:
Barotrauma.EditableParams Barotrauma.IMemorizable< AnimationParams > Barotrauma.ISerializableEntity Barotrauma.GroundedMovementParams Barotrauma.SwimParams Barotrauma.FishGroundedParams Barotrauma.HumanGroundedParams Barotrauma.FishSwimParams Barotrauma.HumanSwimParams Barotrauma.FishRunParams Barotrauma.FishWalkParams Barotrauma.HumanCrouchParams Barotrauma.HumanRunParams Barotrauma.HumanWalkParams Barotrauma.FishSwimFastParams Barotrauma.FishSwimSlowParams Barotrauma.HumanSwimFastParams Barotrauma.HumanSwimSlowParams

Public Member Functions

bool Serialize ()
 
bool Deserialize ()
 
abstract void StoreSnapshot ()
 
void Undo ()
 
void Redo ()
 
void ClearHistory ()
 
- Public Member Functions inherited from Barotrauma.EditableParams
virtual bool Save (string fileNameWithoutExtension=null, System.Xml.XmlWriterSettings settings=null)
 
virtual bool Reset (bool forceReload=false)
 
virtual void AddToEditor (ParamsEditor editor, int space=0)
 
- Public Member Functions inherited from Barotrauma.IMemorizable< AnimationParams >
void StoreSnapshot ()
 
void Undo ()
 
void Redo ()
 
void ClearHistory ()
 

Static Public Member Functions

static string GetDefaultFileName (Identifier speciesName, AnimationType animType)
 
static string GetDefaultFile (Identifier speciesName, AnimationType animType)
 
static string GetFolder (Identifier speciesName)
 
static string GetRandomFilePath (IReadOnlyList< string > filePaths, AnimationType type)
 Selects a random filepath from multiple paths, matching the specified animation type. More...
 
static IEnumerable< string > FilterFilesByType (IEnumerable< string > filePaths, AnimationType type)
 Selects all file paths that match the specified animation type. More...
 
static T GetDefaultAnimParams< T > (Character character, AnimationType animType)
 
static T GetAnimParams< T > (Identifier speciesName, AnimationType animType, string fileName=null)
 If the file name is left null, default file is selected. If fails, will select the default file. Note: Use the filename without the extensions, don't use the full path! If a custom folder is used, it's defined in the character info file. More...
 
static void ClearCache ()
 
static AnimationParams Create (string fullPath, Identifier speciesName, AnimationType animationType, Type type)
 
static T Create< T > (string fullPath, Identifier speciesName, AnimationType animationType)
 Note: Overrides old animations, if found! More...
 
static Type GetParamTypeFromAnimType (AnimationType type, bool isHumanoid)
 

Protected Member Functions

bool Load (ContentPath file, Identifier speciesName)
 
override void UpdatePath (ContentPath newPath)
 
void StoreSnapshot< T > ()
 
- Protected Member Functions inherited from Barotrauma.EditableParams
ContentXElement CreateElement (string name, params object[] attrs)
 
virtual string GetName ()
 
virtual bool Deserialize (XElement element=null)
 
virtual bool Serialize (XElement element=null)
 
virtual bool Load (ContentPath file)
 

Static Protected Member Functions

static string ParseFootAngles (Dictionary< int, float > footAngles)
 
static void SetFootAngles (Dictionary< int, float > footAngles, string value)
 

Static Protected Attributes

static Dictionary< Identifier, Dictionary< string, AnimationParams > > allAnimations = new Dictionary<Identifier, Dictionary<string, AnimationParams>>()
 

Properties

Identifier SpeciesName [get]
 
bool IsGroundedAnimation [get]
 
bool IsSwimAnimation [get]
 
float MovementSpeed [get, set]
 
float CycleSpeed [get, set]
 
float? HeadAngle [get, set]
 In degrees. More...
 
float HeadAngleInRadians = float.NaN [get]
 
float? TorsoAngle [get, set]
 In degrees. More...
 
float TorsoAngleInRadians = float.NaN [get]
 
float HeadTorque [get, set]
 
float TorsoTorque [get, set]
 
float FootTorque [get, set]
 
virtual AnimationType AnimationType [get, protected set]
 
float ArmIKStrength [get, set]
 
float HandIKStrength [get, set]
 
Memento< AnimationParamsMemento = new Memento<AnimationParams>() [get, protected set]
 
- Properties inherited from Barotrauma.EditableParams
bool IsLoaded [get, protected set]
 
string Name [get]
 
string FileName [get]
 
string Folder [get]
 
ContentPath Path = ContentPath.Empty [get, protected set]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get, protected set]
 
virtual ContentXElementMainElement [get]
 
ContentXElement OriginalElement [get, protected set]
 
SerializableEntityEditor SerializableEntityEditor [get, protected set]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 
- Properties inherited from Barotrauma.IMemorizable< AnimationParams >
Memento< T > Memento [get]
 

Additional Inherited Members

- Protected Attributes inherited from Barotrauma.EditableParams
ContentXElement rootElement
 
XDocument doc
 

Detailed Description

Definition at line 65 of file AnimationParams.cs.

Member Function Documentation

◆ ClearCache()

static void Barotrauma.AnimationParams.ClearCache ( )
static

◆ ClearHistory()

void Barotrauma.AnimationParams.ClearHistory ( )

◆ Create()

static AnimationParams Barotrauma.AnimationParams.Create ( string  fullPath,
Identifier  speciesName,
AnimationType  animationType,
Type  type 
)
static

Definition at line 279 of file AnimationParams.cs.

◆ Create< T >()

static T Barotrauma.AnimationParams.Create< T > ( string  fullPath,
Identifier  speciesName,
AnimationType  animationType 
)
static

Note: Overrides old animations, if found!

Type Constraints
T :AnimationParams 
T :new() 

Definition at line 323 of file AnimationParams.cs.

◆ Deserialize()

bool Barotrauma.AnimationParams.Deserialize ( )

◆ FilterFilesByType()

static IEnumerable<string> Barotrauma.AnimationParams.FilterFilesByType ( IEnumerable< string >  filePaths,
AnimationType  type 
)
static

Selects all file paths that match the specified animation type.

Definition at line 174 of file AnimationParams.cs.

◆ GetAnimParams< T >()

static T Barotrauma.AnimationParams.GetAnimParams< T > ( Identifier  speciesName,
AnimationType  animType,
string  fileName = null 
)
static

If the file name is left null, default file is selected. If fails, will select the default file. Note: Use the filename without the extensions, don't use the full path! If a custom folder is used, it's defined in the character info file.

Type Constraints
T :AnimationParams 
T :new() 

Definition at line 207 of file AnimationParams.cs.

◆ GetDefaultAnimParams< T >()

static T Barotrauma.AnimationParams.GetDefaultAnimParams< T > ( Character  character,
AnimationType  animType 
)
static
Type Constraints
T :AnimationParams 
T :new() 

Definition at line 191 of file AnimationParams.cs.

◆ GetDefaultFile()

static string Barotrauma.AnimationParams.GetDefaultFile ( Identifier  speciesName,
AnimationType  animType 
)
static

◆ GetDefaultFileName()

static string Barotrauma.AnimationParams.GetDefaultFileName ( Identifier  speciesName,
AnimationType  animType 
)
static

◆ GetFolder()

static string Barotrauma.AnimationParams.GetFolder ( Identifier  speciesName)
static

Definition at line 142 of file AnimationParams.cs.

◆ GetParamTypeFromAnimType()

static Type Barotrauma.AnimationParams.GetParamTypeFromAnimType ( AnimationType  type,
bool  isHumanoid 
)
static

Definition at line 420 of file AnimationParams.cs.

◆ GetRandomFilePath()

static string Barotrauma.AnimationParams.GetRandomFilePath ( IReadOnlyList< string >  filePaths,
AnimationType  type 
)
static

Selects a random filepath from multiple paths, matching the specified animation type.

Definition at line 166 of file AnimationParams.cs.

◆ Load()

bool Barotrauma.AnimationParams.Load ( ContentPath  file,
Identifier  speciesName 
)
protected

Definition at line 357 of file AnimationParams.cs.

◆ ParseFootAngles()

static string Barotrauma.AnimationParams.ParseFootAngles ( Dictionary< int, float >  footAngles)
staticprotected

Definition at line 391 of file AnimationParams.cs.

◆ Redo()

void Barotrauma.AnimationParams.Redo ( )

◆ Serialize()

bool Barotrauma.AnimationParams.Serialize ( )

◆ SetFootAngles()

static void Barotrauma.AnimationParams.SetFootAngles ( Dictionary< int, float >  footAngles,
string  value 
)
staticprotected

Definition at line 397 of file AnimationParams.cs.

◆ StoreSnapshot()

◆ StoreSnapshot< T >()

Type Constraints
T :AnimationParams 
T :new() 

Definition at line 461 of file AnimationParams.cs.

◆ Undo()

void Barotrauma.AnimationParams.Undo ( )

◆ UpdatePath()

override void Barotrauma.AnimationParams.UpdatePath ( ContentPath  newPath)
protectedvirtual

Reimplemented from Barotrauma.EditableParams.

Definition at line 367 of file AnimationParams.cs.

Member Data Documentation

◆ allAnimations

Dictionary<Identifier, Dictionary<string, AnimationParams> > Barotrauma.AnimationParams.allAnimations = new Dictionary<Identifier, Dictionary<string, AnimationParams>>()
staticprotected

Definition at line 71 of file AnimationParams.cs.

Property Documentation

◆ AnimationType

virtual AnimationType Barotrauma.AnimationParams.AnimationType
getprotected set

Definition at line 131 of file AnimationParams.cs.

◆ ArmIKStrength

float Barotrauma.AnimationParams.ArmIKStrength
getset

Definition at line 134 of file AnimationParams.cs.

◆ CycleSpeed

float Barotrauma.AnimationParams.CycleSpeed
getset

Definition at line 84 of file AnimationParams.cs.

◆ FootTorque

float Barotrauma.AnimationParams.FootTorque
getset

Definition at line 128 of file AnimationParams.cs.

◆ HandIKStrength

float Barotrauma.AnimationParams.HandIKStrength
getset

Definition at line 137 of file AnimationParams.cs.

◆ HeadAngle

float? Barotrauma.AnimationParams.HeadAngle
getset

In degrees.

Definition at line 90 of file AnimationParams.cs.

◆ HeadAngleInRadians

float Barotrauma.AnimationParams.HeadAngleInRadians = float.NaN
get

Definition at line 101 of file AnimationParams.cs.

◆ HeadTorque

float Barotrauma.AnimationParams.HeadTorque
getset

Definition at line 122 of file AnimationParams.cs.

◆ IsGroundedAnimation

bool Barotrauma.AnimationParams.IsGroundedAnimation
get

Definition at line 68 of file AnimationParams.cs.

◆ IsSwimAnimation

bool Barotrauma.AnimationParams.IsSwimAnimation
get

Definition at line 69 of file AnimationParams.cs.

◆ Memento

Memento<AnimationParams> Barotrauma.AnimationParams.Memento = new Memento<AnimationParams>()
getprotected set

Definition at line 459 of file AnimationParams.cs.

◆ MovementSpeed

float Barotrauma.AnimationParams.MovementSpeed
getset

Definition at line 76 of file AnimationParams.cs.

◆ SpeciesName

Identifier Barotrauma.AnimationParams.SpeciesName
get

Definition at line 67 of file AnimationParams.cs.

◆ TorsoAngle

float? Barotrauma.AnimationParams.TorsoAngle
getset

In degrees.

Definition at line 107 of file AnimationParams.cs.

◆ TorsoAngleInRadians

float Barotrauma.AnimationParams.TorsoAngleInRadians = float.NaN
get

Definition at line 119 of file AnimationParams.cs.

◆ TorsoTorque

float Barotrauma.AnimationParams.TorsoTorque
getset

Definition at line 125 of file AnimationParams.cs.