示例#1
0
 private void SetNonEmptyValues(GridValue <T>[,] gridValues)
 {
     foreach (var objectInstance in _gridObjectInstances)
     {
         foreach (var gridReferenceFrameCellPosition in objectInstance.gridReferenceFrameCellPositions)
         {
             gridValues[gridReferenceFrameCellPosition.y, gridReferenceFrameCellPosition.x].value =
                 objectInstance.GetValueAt(gridReferenceFrameCellPosition);
             gridValues[gridReferenceFrameCellPosition.y, gridReferenceFrameCellPosition.x].visual =
                 objectInstance.visual;
         }
     }
 }
示例#2
0
        private GridValue <T>[,] InitializeEmptyGridValues()
        {
            GridValue <T>[,] gridValues = new GridValue <T> [rows, columns];

            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < columns; j++)
                {
                    gridValues[i, j] = new GridValue <T>()
                    {
                        position = new Vector2(j, i),
                        value    = default(T)
                    };
                }
            }

            return(gridValues);
        }