Example #1
0
        internal Channel(string name, ChannelVisibility visibility, RantFormat format, Limit limit)
        {
            Name = name;
            Visiblity = visibility;
            _currentBuffer = new StringBuilder(InitialBufferSize);
            _buffers = new List<StringBuilder>{_currentBuffer};
            _format = format;
	        _articles = false;
	        _limit = limit;
        }
Example #2
0
        public ChannelWriter(RantFormat formatStyle, Limit sizeLimit)
        {
            _sizeLimit = sizeLimit;
            _main = new Channel("main", ChannelVisibility.Public, formatStyle, _sizeLimit);

            _stack = new List<Channel> { _main };
            _stackSize = 1;

            _channels = new Dictionary<string, Channel>
            {
                { "main", _main }
            };
        }
Example #3
0
 public Sandbox(RantEngine engine, RantPattern pattern, RNG rng, int sizeLimit = 0, RantPatternArgs args = null)
 {
     _engine     = engine;
     _format     = engine.Format;
     _sizeLimit  = new Limit(sizeLimit);
     _baseOutput = new OutputWriter(this);
     _outputs    = new Stack <OutputWriter>();
     _outputs.Push(_baseOutput);
     _rng               = rng;
     _startingGen       = rng.Generation;
     _pattern           = pattern;
     _objects           = new ObjectStack(engine.Objects);
     _blocks            = new Stack <BlockState>();
     _matches           = new Stack <Match>();
     _queryState        = new QueryState();
     _subroutineArgs    = new Stack <Dictionary <string, RantAction> >();
     _syncManager       = new SyncManager(this);
     _blockManager      = new BlockManager();
     _scriptObjectStack = new Stack <object>();
     _patternArgs       = args;
     _stopwatch         = new Stopwatch();
 }
Example #4
0
		public Sandbox(RantEngine engine, RantPattern pattern, RNG rng, int sizeLimit = 0)
		{
			_engine = engine;
			_format = engine.Format;
			_sizeLimit = new Limit(sizeLimit);
			_mainOutput = new ChannelWriter(_format, _sizeLimit);
			_outputs = new Stack<ChannelWriter>();
			_outputs.Push(_mainOutput);
			_rng = rng;
			_startingGen = rng.Generation;
			_pattern = pattern;
			_objects = new ObjectStack(engine.Objects);
			_blocks = new Stack<BlockState>();
			_matches = new Stack<Match>();
			_queryState = new QueryState();
			_subroutineArgs = new Stack<Dictionary<string, RantAction>>();
			_syncManager = new SyncManager(this);
            _blockManager = new BlockManager();
			_scriptObjectStack = new Stack<object>();
            _stopwatch = new Stopwatch();
		}