More refactoring.
This commit is contained in:
parent
2311019f4e
commit
be989a233d
|
@ -28,7 +28,7 @@ namespace IngameScript
|
|||
Name = zoneName;
|
||||
_program = program;
|
||||
_console = new PrefixedConsole(program.Console, zoneName);
|
||||
_sequencer = new Sequencer(zoneName, _console);
|
||||
_sequencer = new Sequencer(program, zoneName);
|
||||
}
|
||||
|
||||
public void AddBlock(IMyTerminalBlock block)
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace IngameScript
|
|||
// Create the door if this is a new id
|
||||
if (!_doors.ContainsKey(doorName))
|
||||
{
|
||||
_doors[doorName] = new Sequencer(doorName, new PrefixedConsole(Console, doorName));
|
||||
_doors[doorName] = new Sequencer(this, doorName);
|
||||
}
|
||||
|
||||
// Add the part; the Door object handles typing and sequencing.
|
||||
|
|
|
@ -33,12 +33,12 @@ namespace IngameScript
|
|||
// Either use a reference to that instance directly where needed or use it to create PrefixedConsoles.
|
||||
public class MainConsole : IConsole
|
||||
{
|
||||
private Program _program;
|
||||
private int _maxLines;
|
||||
private List<string> _buffer;
|
||||
private StringBuilder _builder;
|
||||
private string _programName;
|
||||
private List<string> _buffer = new List<string>();
|
||||
private StringBuilder _builder = new StringBuilder();
|
||||
private int _tickCount = 0;
|
||||
private Program _program;
|
||||
private string _programName;
|
||||
private int _maxLines;
|
||||
|
||||
private const int DefaultMaxLines = 10;
|
||||
|
||||
|
@ -46,8 +46,6 @@ namespace IngameScript
|
|||
{
|
||||
_program = program;
|
||||
_programName = programName;
|
||||
_buffer = new List<string>();
|
||||
_builder = new StringBuilder();
|
||||
|
||||
// Check the PB's custom data for a maxlines directive.
|
||||
_program.Ini.TryParse(program.Me.CustomData);
|
||||
|
|
|
@ -11,11 +11,12 @@ namespace IngameScript
|
|||
public bool Running { get; }
|
||||
public int Step { get; set; }
|
||||
|
||||
private IMyDoor _door;
|
||||
public bool DeployOpen { get; set; }
|
||||
public bool LockOpen { get; set; }
|
||||
public bool LockClosed { get; set; }
|
||||
|
||||
private IMyDoor _door;
|
||||
|
||||
public SequenceableDoor(
|
||||
IMyDoor door,
|
||||
MyIni ini,
|
||||
|
|
|
@ -16,13 +16,12 @@ namespace IngameScript
|
|||
private IConsole _console;
|
||||
private string _name;
|
||||
|
||||
private SortedDictionary<int, List<ISequenceable>> _sequence;
|
||||
private SortedDictionary<int, List<ISequenceable>> _sequence = new SortedDictionary<int, List<ISequenceable>>();
|
||||
|
||||
public Sequencer(string name, IConsole console)
|
||||
public Sequencer(IConsoleProgram program, string name)
|
||||
{
|
||||
_name = name;
|
||||
_console = console;
|
||||
_sequence = new SortedDictionary<int, List<ISequenceable>>();
|
||||
_console = new PrefixedConsole(program.Console, _name);
|
||||
}
|
||||
|
||||
public void AddBlock(ISequenceable block)
|
||||
|
|
Loading…
Reference in New Issue
Block a user