ClassiCube/ClassicalSharp/Rendering/EnvRenderer.cs
2015-12-29 16:24:54 +11:00

35 lines
928 B
C#

using System;
using ClassicalSharp.GraphicsAPI;
namespace ClassicalSharp.Renderers {
public abstract class EnvRenderer : IDisposable {
protected Map map;
protected Game game;
protected IGraphicsApi graphics;
public virtual void Init() {
graphics = game.Graphics;
game.MapEvents.OnNewMap += OnNewMap;
game.MapEvents.OnNewMapLoaded += OnNewMapLoaded;
game.MapEvents.EnvVariableChanged += EnvVariableChanged;
}
public virtual void OnNewMap( object sender, EventArgs e ) {
}
public virtual void OnNewMapLoaded( object sender, EventArgs e ) {
}
public virtual void Dispose() {
game.MapEvents.OnNewMap -= OnNewMap;
game.MapEvents.OnNewMapLoaded -= OnNewMapLoaded;
game.MapEvents.EnvVariableChanged -= EnvVariableChanged;
}
public abstract void Render( double deltaTime );
protected abstract void EnvVariableChanged( object sender, EnvVarEventArgs e );
}
}