Oops, interface implementations on Program don't carry over into the compiled game script. IConsoleProgram will have to just stand as a compile-time checking convenience.

This commit is contained in:
Anna Rose 2025-02-14 16:20:50 -05:00
parent 372e9e22d2
commit 54f04a7cf0
3 changed files with 7 additions and 11 deletions

View File

@ -38,7 +38,7 @@ namespace IngameScript
public List<IMyAirVent> Vents { get; } = new List<IMyAirVent>();
private IConsoleProgram _program;
private Program _program;
// private List<IMyTextSurface> _displays = new List<IMyTextSurface>(); // TODO: add single-zone displays
private List<IMyLightingBlock> _lights = new List<IMyLightingBlock>();
@ -48,7 +48,7 @@ namespace IngameScript
private const float TriggerLevel = 0.75F;
public AirZone(IConsoleProgram program, string zoneName)
public AirZone(Program program, string zoneName)
{
Name = zoneName;
_program = program;

View File

@ -86,7 +86,7 @@ namespace IngameScript
private const int CooldownTicks = 12;
private const int SealTimeoutTicks = 30;
public Airlock(string name, IConsoleProgram _program)
public Airlock(string name, Program _program)
{
_ini = _program.Ini;
_name = name;
@ -121,7 +121,8 @@ namespace IngameScript
// Precondition: _ini.TryParse() should be called on the block before calling this function.
private void addVent(IMyAirVent vent)
{
if (_airVent == null) {
if (_airVent == null)
{
_airVent = vent;
return;
}

View File

@ -23,11 +23,6 @@ namespace IngameScript
// Properties that should be defined by the implementer.
MyIni Ini { get; }
Program.IConsole Console { get; }
// Inherited properties that we need access to
IMyGridProgramRuntimeInfo Runtime { get; }
IMyProgrammableBlock Me { get; }
Action<string> Echo { get; }
}
partial class Program
@ -46,13 +41,13 @@ namespace IngameScript
private List<string> _buffer = new List<string>();
private StringBuilder _builder = new StringBuilder();
private int _tickCount = 0;
private IConsoleProgram _program;
private Program _program;
private string _programName;
private int _maxLines = 10;
private const int DefaultMaxLines = 10;
public MainConsole(IConsoleProgram program, string programName)
public MainConsole(Program program, string programName)
{
_program = program;
_programName = programName;