stageEvents/StageEvent.cs

Abstract base class for a stage event used by the game. It stores the event type, a TimeSince timer for how long the event has been running, and a lifetime. It provides virtual Start, Update, and Remove methods that derived events can override.

using System;
using System.Reflection;
using Sandbox;

public abstract class StageEvent
{
	public EventType EventType { get; set; }
	public TimeSince TimeSinceStart { get; private set; }
	public float Lifetime { get; set;}

	public virtual void Start( int randSeed )
	{
		TimeSinceStart = 0f;
	}

	public virtual void Update()
	{

	}

	public virtual void Remove()
	{

	}
}