Пример #1
0
        // Allow swapping of contents, to avoid mucking with the array of objects, and/or updating cell indexes
        public void SwapCells(BoardElement oBoardElement1, BoardElement oBoardElement2)
        {
            // Note: Preserve cell index, swap contents
            // TODO: Make this less retarded

            BoardElementBaseType eBoardElementBaseType = oBoardElement1.m_eBoardElementBaseType;

            oBoardElement1.m_eBoardElementBaseType = oBoardElement2.m_eBoardElementBaseType;
            oBoardElement2.m_eBoardElementBaseType = eBoardElementBaseType;
        }
Пример #2
0
 public void InitializeEmptyBoard_DefaultSize()
 {
     m_oBoardElementArray = new BoardElement[6, 5];
     for (var nColumn = m_oBoardElementArray.GetLowerBound(0); nColumn <= m_oBoardElementArray.GetUpperBound(0); ++nColumn)
     {
         for (var nRow = m_oBoardElementArray.GetLowerBound(1); nRow <= m_oBoardElementArray.GetUpperBound(1); ++nRow)
         {
             m_oBoardElementArray[nColumn, nRow] = new BoardElement
             {
                 m_CellIndex = new CellIndex {
                     m_nColumn = nColumn, m_nRow = nRow
                 },
                 m_eBoardElementBaseType = BoardElementBaseType.Transitory_Empty,
             };
         }
     }
 }