source: binary-improvements/MapRendering/API.cs@ 330

Last change on this file since 330 was 326, checked in by alloc, 6 years ago

More cleanup, allocation improvements

File size: 909 bytes
RevLine 
[325]1using AllocsFixes.NetConnections.Servers.Web;
2using AllocsFixes.NetConnections.Servers.Web.Handlers;
[224]3
[325]4namespace MapRendering {
[324]5 public class API : IModApi {
[325]6 public void InitMod () {
7 ModEvents.GameAwake.RegisterHandler (GameAwake);
8 ModEvents.GameStartDone.RegisterHandler (GameStartDone);
9 ModEvents.GameShutdown.RegisterHandler (GameShutdown);
10 ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone);
11 }
12
[324]13 private void GameAwake () {
14 // ReSharper disable once ObjectCreationAsStatement
[325]15 new Web ();
[326]16 LogBuffer.Init ();
[224]17 }
18
[324]19 private void GameStartDone () {
[325]20 if (ItemIconHandler.Instance != null) {
21 ItemIconHandler.Instance.LoadIcons ();
[291]22 }
23 }
[267]24
[324]25 private void GameShutdown () {
[299]26 AllocsFixes.MapRendering.MapRendering.Shutdown ();
27 }
28
[324]29 private void CalcChunkColorsDone (Chunk _chunk) {
[224]30 AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk);
31 }
32 }
[325]33}
Note: See TracBrowser for help on using the repository browser.