-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyWorld.cs
57 lines (41 loc) · 1.11 KB
/
MyWorld.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using DynamicInvasions.Invasion;
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
namespace DynamicInvasions {
class DynamicInvasionsWorld : ModWorld {
public InvasionLogic Logic { get; private set; }
////////////////
public override void Initialize() {
var mymod = (DynamicInvasionsMod)this.mod;
this.Logic = new InvasionLogic();
}
internal void Uninitialize() {
this.Logic = null;
}
////////////////
public override void Load( TagCompound tags ) {
if( DynamicInvasionsMod.Config.DebugModeReset ) {
Main.invasionDelay = 0;
} else {
this.Logic.LoadMe( tags );
}
}
public override TagCompound Save() {
return this.Logic.SaveMe();
}
//public override void NetSend( BinaryWriter writer ) {
//this.Logic.GetNetSender()( writer );
//}
//public override void NetReceive( BinaryReader reader ) {
//this.Logic.GetNetReceiver()( reader );
//}
////////////////
public override void PreUpdate() {
if( !DynamicInvasionsMod.Config.Enabled ) { return; }
if( Main.netMode == 2 ) { // Server
this.Logic.Update();
}
}
}
}