Park/IBuilder.cs
namespace HC3;
/// <summary>
/// Defines a building mode/tool -- ideally you can only run one of these at the same time, so we have <see cref="DeactivateAll"/>
/// Activate to turn it on, Deactivate to turn it off.
/// TODO: Maybe it's worth having a static here, or a singleton.
/// </summary>
public interface IBuilder : IValid
{
public void Activate();
public void Deactivate();
/// <summary>
/// Deactivate all other builders
/// </summary>
public void DeactivateAll()
{
var builders = Game.ActiveScene.GetAll<IBuilder>();
foreach ( var builder in builders.Where( x => x != this ) )
{
builder.Deactivate();
}
}
}