tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.ContentInstance< T > Class Template Reference
+ Collaboration diagram for Terraria.ModLoader.ContentInstance< T >:

Classes

class  ContentEntry
 

Static Public Member Functions

static void Register (object obj)
 

Properties

static T Instance [get, private set]
 
static IReadOnlyList< T > Instances [get, private set]
 

Static Private Member Functions

static ContentInstance ()
 
static ContentEntry Factory (Type t)
 
static void Update (object instance, IEnumerable instances)
 

Static Private Attributes

static ConcurrentDictionary< Type, ContentEntrycontentByType = new ConcurrentDictionary<Type, ContentEntry>()
 

Detailed Description

Type Constraints
T :class 

Definition at line 64 of file ContentInstance.cs.

Constructor & Destructor Documentation

◆ ContentInstance()

static Terraria.ModLoader.ContentInstance< T >.ContentInstance ( )
staticprivate

Definition at line 69 of file ContentInstance.cs.

69 {
70 ContentInstance.Link(typeof(T), Update);
71 }
static void Update(object instance, IEnumerable instances)

References Terraria.ModLoader.ContentInstance< T >.Update().

+ Here is the call graph for this function:

Member Function Documentation

◆ Factory()

static ContentEntry Terraria.ModLoader.ContentInstance< T >.Factory ( Type  t)
staticprivate

◆ Register()

◆ Update()

static void Terraria.ModLoader.ContentInstance< T >.Update ( object  instance,
IEnumerable  instances 
)
staticprivate

Definition at line 73 of file ContentInstance.cs.

73 {
74 Instance = (T)instance;
75 Instances = instances?.Cast<T>()?.ToArray();
76 }
static IReadOnlyList< T > Instances

References Terraria.ModLoader.ContentInstance< T >.Instance, and Terraria.ModLoader.ContentInstance< T >.Instances.

Referenced by Terraria.ModLoader.ContentInstance< T >.ContentInstance().

+ Here is the caller graph for this function:

Member Data Documentation

◆ contentByType

ConcurrentDictionary<Type, ContentEntry> Terraria.ModLoader.ContentInstance< T >.contentByType = new ConcurrentDictionary<Type, ContentEntry>()
staticprivate

Definition at line 50 of file ContentInstance.cs.

Referenced by Terraria.ModLoader.ContentInstance< T >.Register().

Property Documentation

◆ Instance

T Terraria.ModLoader.ContentInstance< T >.Instance
staticgetprivate set

Definition at line 66 of file ContentInstance.cs.

66{ get; private set; }

Referenced by Terraria.ModLoader.ContentInstance< T >.Update().

◆ Instances

IReadOnlyList<T> Terraria.ModLoader.ContentInstance< T >.Instances
staticgetprivate set

Definition at line 67 of file ContentInstance.cs.

67{ get; private set; }

Referenced by Terraria.ModLoader.ContentInstance< T >.Update().