mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-26 19:12:07 -05:00
35 lines
928 B
C#
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 );
|
|
}
|
|
}
|