-
Notifications
You must be signed in to change notification settings - Fork 0
/
EventData.cs
37 lines (32 loc) · 1.03 KB
/
EventData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
namespace ChallengeChest;
[Serializable]
public class EventData
{
public Difficulty difficulty;
public SimpleVector2 pos;
public long despawnTime;
public SimpleVector2 zone;
public EventData(Difficulty difficulty, SimpleVector2 pos, SimpleVector2 zone, long despawnTime) : this()
{
this.difficulty = difficulty;
this.pos = pos;
this.zone = zone;
this.despawnTime = despawnTime;
}
public EventData()
{
}
public Heightmap.Biome GetBiome() => WorldGenerator.instance.GetBiome(pos.x, pos.y);
public Vector2i GetZone() => new(zone.ToVector2());
public Vector2i GetZoneTrue() => pos.ToVector2().ToV3().GetZone();
public override string ToString()
{
return
$"{nameof(difficulty)}: {difficulty}, " +
$"{nameof(pos)}: {pos}, " +
$"{nameof(despawnTime)}: {despawnTime}, " +
$"{nameof(zone)}: {zone}, " +
$"{nameof(GetZone)}: {GetZone()}, " +
$"{nameof(GetZoneTrue)}: {GetZoneTrue()}";
}
}