コード例 #1
0
ファイル: Table.cs プロジェクト: STzvetkov/KingSurvival5
        private void InitializeCells(IFieldCellFactory cellCreator)
        {
            if (cellCreator == null)
            {
                throw new ArgumentNullException("Class table cant correctly initialize with a null reference for a cellCreator");
            }

            FieldCell[,] cells = new FieldCell[cellCreator.RowCount, cellCreator.ColCount];

            for (int i = 0; i < cellCreator.RowCount; i++)
            {
                for (int j = 0; j < cellCreator.ColCount; j++)
                {
                    cells[i, j] = cellCreator.GenerateNextCell();
                }
            }

            this.Cells = cells;
        }
コード例 #2
0
ファイル: Table.cs プロジェクト: STzvetkov/KingSurvival5
 public Table(IFieldCellFactory cellCreator, IFrame frame)
 {
     this.InitializeCells(cellCreator);
     this.Frame = frame;
 }