Don't actually use the IConsoleProgram interface in code since it would require a huge number of casts and everything is inside Program anyway.
This commit is contained in:
parent
06be2bf30e
commit
66fff69396
|
@ -14,7 +14,7 @@ namespace IngameScript
|
|||
public bool Triggered { get; private set; } = false;
|
||||
public List<IMyAirVent> Vents { get; } = new List<IMyAirVent>();
|
||||
|
||||
private IConsoleProgram _program;
|
||||
private Program _program;
|
||||
private List<IMyDoor> _doors = new List<IMyDoor>();
|
||||
private List<IMyTextSurface> _displays = new List<IMyTextSurface>();
|
||||
private List<IMyLightingBlock> _lights = new List<IMyLightingBlock>();
|
||||
|
@ -23,12 +23,12 @@ namespace IngameScript
|
|||
|
||||
private const float TriggerLevel = 0.75F;
|
||||
|
||||
public AirZone(string zoneName, IConsoleProgram program)
|
||||
public AirZone(Program program, string zoneName)
|
||||
{
|
||||
Name = zoneName;
|
||||
_program = program;
|
||||
_console = new PrefixedConsole(program.Console, zoneName);
|
||||
_sequencer = new Sequencer(program, zoneName);
|
||||
_console = new PrefixedConsole(_program.Console, Name);
|
||||
_sequencer = new Sequencer(_program, Name);
|
||||
}
|
||||
|
||||
public void AddBlock(IMyTerminalBlock block)
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace IngameScript
|
|||
{
|
||||
if (!_zones.ContainsKey(zone))
|
||||
{
|
||||
_zones[zone] = new AirZone(zone, this);
|
||||
_zones[zone] = new AirZone(this, zone);
|
||||
}
|
||||
_zones[zone].AddBlock(block);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace IngameScript
|
|||
private const int CooldownTicks = 120;
|
||||
private const int SealTimeoutTicks = 30;
|
||||
|
||||
public Airlock(string name, IConsoleProgram _program)
|
||||
public Airlock(string name, Program _program)
|
||||
{
|
||||
_ini = _program.Ini;
|
||||
_name = name;
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace IngameScript
|
|||
{
|
||||
// A Program that supports consoles by initializing a MyIni instance
|
||||
// and providing a public console for member objects to refer back to.
|
||||
// If you're using this library it is highly advised that you implement this interface
|
||||
// for a clean, consistent way to avoid errors.
|
||||
//
|
||||
// (It is probably an anti-pattern that this lives outside of the Program class,
|
||||
// but we can't find a cleaner way to implement this.)
|
||||
public interface IConsoleProgram
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace IngameScript
|
|||
|
||||
private SortedDictionary<int, List<ISequenceable>> _sequence = new SortedDictionary<int, List<ISequenceable>>();
|
||||
|
||||
public Sequencer(IConsoleProgram program, string name)
|
||||
public Sequencer(Program program, string name)
|
||||
{
|
||||
Name = name;
|
||||
_console = new PrefixedConsole(program.Console, Name);
|
||||
|
|
Loading…
Reference in New Issue
Block a user