Example #1
0
        public GraphicsElementLayer(string name, int order)
        {
            Name  = !string.IsNullOrEmpty(name) ? name : throw new ArgumentNullException(nameof(name));
            Order = order;

            elements  = new LinearGrowthArray <GraphicsElement>(ElementsCapacity);
            locations = new LinearGrowthArray <GraphicsElementLocation>(ElementsCapacity);

            // Create initial grid.
            grid = new GraphicsElementCell[InitialRows][];

            for (var i = 0; i < InitialRows; i++)
            {
                grid[i] = new GraphicsElementCell[InitialColumns];

                for (var j = 0; j < InitialColumns; j++)
                {
                    grid[i][j] = new GraphicsElementCell();
                }
            }
        }
Example #2
0
 public SharedEventQueue(int queueBucketSize)
 {
     events = new LinearGrowthArray <EventDispatchContext <TKey, TSubscriber> >(queueBucketSize);
     topics = new Dictionary <TKey, List <TSubscriber> >();
 }
Example #3
0
 public LinearStorageObject(LinearGrowthArray <T> storage)
 => this.storage = storage ?? throw new ArgumentNullException(nameof(storage));