5 private int m_iMaxColumns;
6 private int m_iMaxRows;
9 private ref array<ref SCR_MatrixRow> m_iMatrix;
13 array<int> Reserve1stFreePlace(
int sizeCols,
int sizeRows )
16 for(
int iRow = 0; iRow < m_iMatrix.Count(); iRow++ )
18 for(
int iCol = 0; iCol < m_iMaxColumns; iCol++ )
20 retVal = ReservePlace( sizeCols, sizeRows, iCol, iRow );
21 if( ( retVal[0] != -1 ) && ( retVal[1] != -1 ) )
31 array<int> ReservePlace(
int sizeCols,
int sizeRows,
int col,
int row )
34 if( ( sizeRows + row ) > m_iMatrix.Count() )
40 for(
int iRow = row; iRow < ( sizeRows + row ); iRow++ )
43 bool bFree = aRow.CheckFreePlaceInRow( sizeCols, col );
49 for(
int iRow = row; iRow < ( sizeRows + row ); iRow++ )
52 aRow.ReservePlaceInRow( sizeCols, col );
60 for(
int i = 0; i < m_iMatrix.Count(); i++)
61 m_iMatrix.Get( i ).Debug();
65 private void GetRow(
int rowIndex, out notnull
SCR_MatrixRow row )
67 row = m_iMatrix.Get( rowIndex );
71 int GetElement(
int col,
int row )
75 int retVal = m_iMatrix.Get( row ).GetElement( col );
80 void SetElement(
int col,
int row,
int value )
82 m_iMatrix.Get( row ).SetElement( col, value );
89 m_iMatrix.Insert( row );
94 for(
int iLoop = 0; iLoop < m_iMaxRows; iLoop++ )
95 for(
int jLoop = 0; jLoop < m_iMaxColumns; jLoop++ )
96 SetElement( jLoop, iLoop, 0);
103 m_iMaxColumns = cols;
106 m_iMatrix =
new array<ref SCR_MatrixRow>();
108 for(
int iLoop = 0; iLoop < rows; iLoop++ )