public BerlinClock(IRowGenerator topFirstRow, IRowGenerator topSecondRow, IRowGenerator bottomFirstRow, IRowGenerator bottomSecondRow, IRowGenerator lampGenerator)
 {
     _topFirstRow = topFirstRow;
     _topSecondRow = topSecondRow;
     _bottomFirstRow = bottomFirstRow;
     _bottomSecondRow = bottomSecondRow;
     _lampGenerator = lampGenerator;
     _hourBiggestFit = new ValueBiggestFit(new List<int>{5, 10, 15, 20});
     _minuteBiggestFit = new ValueBiggestFit(new List<int>{5, 10, 15, 20, 25, 30, 35, 40, 35, 50 ,55});
 }
 public BerlinClock(IRowGenerator topFirstRow, IRowGenerator topSecondRow, IRowGenerator bottomFirstRow, IRowGenerator bottomSecondRow, IRowGenerator lampGenerator)
 {
     _topFirstRow     = topFirstRow;
     _topSecondRow    = topSecondRow;
     _bottomFirstRow  = bottomFirstRow;
     _bottomSecondRow = bottomSecondRow;
     _lampGenerator   = lampGenerator;
     _hourBiggestFit  = new ValueBiggestFit(new List <int> {
         5, 10, 15, 20
     });
     _minuteBiggestFit = new ValueBiggestFit(new List <int> {
         5, 10, 15, 20, 25, 30, 35, 40, 35, 50, 55
     });
 }
Beispiel #3
0
        public RandomTextGenerator(long fileSizeMax, IRowGenerator <Row> rowGenerator)
        {
            _rowGenerator = rowGenerator ?? throw new ArgumentNullException(nameof(rowGenerator));

            var minRowSize = rowGenerator.GetRowMinSize();

            if (minRowSize > fileSizeMax)
            {
                throw new ArgumentException($"file size must be more or equal {minRowSize}, but current value {fileSizeMax}");
            }

            var rowGeneratorEnumerable = rowGenerator.GetEnumerator() ?? throw new ArgumentException($"IEnumerable for {nameof(rowGenerator.GetEnumerator)} is null");

            _rowCurrentEnumerator = rowGeneratorEnumerable.GetEnumerator() ?? throw new ArgumentException($"IEnumerator for {nameof(rowGenerator.GetEnumerator)} is null");
            _fileSizeMax          = fileSizeMax;
            _current = null;
        }
        public static void PopulateList(ListElement listElement)
        {
            Controls           controls     = listElement.Controls;
            SerializedProperty property     = listElement.SerializedProperty;
            IRowGenerator      rowGenerator = listElement.RowGenerator;

            controls.ItemsSection.Clear();

            for (int i = 0; i < property.arraySize; i++)
            {
                controls.ItemsSection.Add(rowGenerator.NewRow(i, property));
                listElement.SendEvent(new RowInsertedEvent
                {
                    target        = listElement,
                    Buttons       = controls.Row[i],
                    PropertyField = controls.Row[i].PropertyField,
                    Index         = i,
                    ListLength    = property.arraySize
                });
            }
        }
Beispiel #5
0
 public SimpleGenerator(IRowGenerator rowGenerator)
 {
     _rowGenerator = rowGenerator;
 }
Beispiel #6
0
 public CouponGenerator(Configuration configuration, IRowGenerator rowGenerator)
 {
     _configuration = configuration;
     _rowGenerator  = rowGenerator;
 }