Terraria ModLoader  0.11.7.8
A mod to make and play Terraria mods
MapEntry.cs
Go to the documentation of this file.
1 using Microsoft.Xna.Framework;
2 using System;
3 using Terraria.Localization;
4 
5 namespace Terraria.ModLoader
6 {
7  internal struct MapEntry
8  {
9  internal Color color;
10  internal LocalizedText name;
11  internal ModTranslation translation;
12  internal Func<string, int, int, string> getName;
13 
14  internal MapEntry(Color color, LocalizedText name = null) {
15  if (name == null) {
16  name = LocalizedText.Empty;
17  }
18  this.color = color;
19  this.name = name;
20  this.translation = null;
21  this.getName = sameName;
22  }
23 
24  internal MapEntry(Color color, ModTranslation name) {
25  this.color = color;
26  this.name = null;
27  this.translation = name;
28  this.getName = sameName;
29  }
30 
31  internal MapEntry(Color color, LocalizedText name, Func<string, int, int, string> getName) {
32  this.color = color;
33  this.name = name;
34  this.translation = null;
35  this.getName = getName;
36  }
37 
38  internal MapEntry(Color color, ModTranslation name, Func<string, int, int, string> getName) {
39  this.color = color;
40  this.name = null;
41  this.translation = name;
42  this.getName = getName;
43  }
44 
45  private static string sameName(string name, int x, int y) {
46  return name;
47  }
48  }
49 }