tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.MapLegend Class Reference
+ Collaboration diagram for Terraria.ModLoader.MapLegend:

Public Member Functions

 MapLegend (int size)
 
string FromTile (MapTile mapTile, int x, int y)
 
LocalizedText FromType (int type)
 

Properties

int Length [get]
 
LocalizedText this[int i] [get, set]
 

Private Attributes

LocalizedText[] legend
 

Detailed Description

Definition at line 8 of file MapLegend.cs.

Constructor & Destructor Documentation

◆ MapLegend()

Terraria.ModLoader.MapLegend.MapLegend ( int  size)

Definition at line 13 of file MapLegend.cs.

13 {
14 legend = new LocalizedText[size];
15 }
LocalizedText[] legend
Definition: MapLegend.cs:11

References Terraria.ModLoader.MapLegend.legend.

Member Function Documentation

◆ FromTile()

string Terraria.ModLoader.MapLegend.FromTile ( MapTile  mapTile,
int  x,
int  y 
)

Definition at line 45 of file MapLegend.cs.

45 {
46 string name = legend[mapTile.Type].Value;
47 if (MapLoader.nameFuncs.ContainsKey(mapTile.Type)) {
48 name = MapLoader.nameFuncs[mapTile.Type](name, x, y);
49 }
50 return name;
51 }

References Terraria.ModLoader.MapLegend.legend.

◆ FromType()

LocalizedText Terraria.ModLoader.MapLegend.FromType ( int  type)

Definition at line 40 of file MapLegend.cs.

40 {
41 return this[MapHelper.TileToLookup(type, 0)];
42 }

Member Data Documentation

◆ legend

LocalizedText [] Terraria.ModLoader.MapLegend.legend
private

Property Documentation

◆ Length

int Terraria.ModLoader.MapLegend.Length
get

Definition at line 17 of file MapLegend.cs.

17 {
18 get {
19 return legend.Length;
20 }
21 }

◆ this[int i]

LocalizedText Terraria.ModLoader.MapLegend.this[int i]
getset

Definition at line 27 of file MapLegend.cs.

27 {
28 get {
29 return legend[i];
30 }
31 set {
32 legend[i] = value;
33 }
34 }