Terraria ModLoader  0.10.1.5
A framework for Terraria mods
Terraria.ModLoader.IO.TagIO.PayloadHandler< T > Class Template Referenceabstract
+ Inheritance diagram for Terraria.ModLoader.IO.TagIO.PayloadHandler< T >:
+ Collaboration diagram for Terraria.ModLoader.IO.TagIO.PayloadHandler< T >:

Public Member Functions

 PayloadHandler (Func< BinaryReader, T > reader, Action< BinaryWriter, T > writer)
 
abstract object Clone (object o)
 
override object Clone (object o)
 
abstract IList CloneList (IList list)
 
override IList CloneList (IList list)
 
virtual IList CloneList (IList< T > list)
 
abstract object Default ()
 
override object Default ()
 
abstract object Read (BinaryReader r)
 
override object Read (BinaryReader r)
 
abstract IList ReadList (BinaryReader r, int size)
 
override IList ReadList (BinaryReader r, int size)
 
abstract void Write (BinaryWriter w, object v)
 
override void Write (BinaryWriter w, object v)
 
abstract void WriteList (BinaryWriter w, IList list)
 
override void WriteList (BinaryWriter w, IList list)
 
void WriteList (BinaryWriter w, IList< T > list)
 

Public Attributes

override Type PayloadType => typeof(T)
 

Properties

abstract Type PayloadType [get]
 

Detailed Description

Definition at line 25 of file TagIO.cs.

Constructor & Destructor Documentation

Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.PayloadHandler ( Func< BinaryReader, T >  reader,
Action< BinaryWriter, T >  writer 
)

Definition at line 30 of file TagIO.cs.

30  {
31  this.reader = reader;
32  this.writer = writer;
33  }

Member Function Documentation

abstract object Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Clone ( object  o)
pure virtual
override object Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Clone ( object  o)
abstract IList Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.CloneList ( IList  list)
pure virtual
override IList Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.CloneList ( IList  list)
virtual IList Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.CloneList ( IList< T >  list)
virtual
abstract object Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Default ( )
pure virtual
override object Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Default ( )
abstract object Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Read ( BinaryReader  r)
pure virtual
override object Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Read ( BinaryReader  r)
abstract IList Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.ReadList ( BinaryReader  r,
int  size 
)
pure virtual
override IList Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.ReadList ( BinaryReader  r,
int  size 
)

Definition at line 39 of file TagIO.cs.

39  {
40  var list = new List<T>(size);
41  for (int i = 0; i < size; i++)
42  list.Add(reader(r));
43 
44  return list;
45  }
abstract void Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Write ( BinaryWriter  w,
object  v 
)
pure virtual
override void Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.Write ( BinaryWriter  w,
object  v 
)
abstract void Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.WriteList ( BinaryWriter  w,
IList  list 
)
pure virtual
override void Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.WriteList ( BinaryWriter  w,
IList  list 
)
void Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.WriteList ( BinaryWriter  w,
IList< T >  list 
)

Definition at line 48 of file TagIO.cs.

48  {
49  foreach (T t in list)
50  writer(w, t);
51  }

Member Data Documentation

override Type Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.PayloadType => typeof(T)

Definition at line 35 of file TagIO.cs.

Property Documentation

abstract Type Terraria.ModLoader.IO.TagIO.PayloadHandler< T >.PayloadType
get

Definition at line 15 of file TagIO.cs.