matrixRectGetter method

RectGetter matrixRectGetter(
  1. int xIndex,
  2. int yIndex, {
  3. int? toXIndex,
  4. int? toYIndex,
  5. String? named,
  6. List<String> extras = const [],
  7. Size? sampleSortSize,
})

进行逻辑坐标系到矩阵坐标系转换

Implementation

RectGetter matrixRectGetter(int xIndex, int yIndex, {int? toXIndex, int? toYIndex, String? named, List<String> extras = const [], Size? sampleSortSize}){
  // gameDebug('matrixRectGetter:x:$xIndex,y:$yIndex,toX:$toXIndex,toY:$toYIndex');
  if(toXIndex != null || toYIndex != null){
    return (Size size)=>matrixRectGetter(xIndex, yIndex, named: named, extras: extras, sampleSortSize: sampleSortSize)(size).expandToInclude(
      matrixRectGetter(toXIndex ?? xIndex, toYIndex ?? yIndex, named: named, extras: extras, sampleSortSize: sampleSortSize)(size));
  }
  return (named != null ? namedMatrix(named: named, extras: extras, sampleSortSize: sampleSortSize) : matrix)[yIndex][xIndex];
}