Exemple #1
0
 public GeneratorBlock(string name, IEnumerable <IPart> producesParts, IBuffer outputBuffer, IBlockProgram blockProgram, ILogger logger = null)
     : base(logger)
 {
     _name          = name;
     _producesParts = producesParts;
     _outputBuffer  = outputBuffer;
     _blockProgram  = blockProgram;
 }
Exemple #2
0
        public Block(string name, IEnumerable <IPart> producesParts, IBuffer inputBuffer, IBuffer outputBuffer, IBlockProgram blockProgram, ILogger logger = null)
            : base(logger)
        {
            _name          = name;
            _producesParts = producesParts.ToHashSet();
            _usesParts     = _producesParts.SelectMany(p => p.MadeFrom).ToHashSet();
            _inputBuffer   = inputBuffer;
            _outputBuffer  = outputBuffer;

            _blockProgram = blockProgram;

            IdleTicks = 0;
            Ticks     = 0;

            Log("Created.");
        }