//Constructs the range array for this Range. Uses the minRange and max range to fill in the booleans //Returns either a box or straight lines depending on if we have straightLines as a play condition //Can be overriden if we have cards with some weird ranges protected virtual bool[,] GetRangeArray() { var array = new bool[MaxRange * 2 + 1, MaxRange * 2 + 1]; for (int i = 0; i < MaxRange * 2 + 1; i++) { for (int j = 0; j < MaxRange * 2 + 1; j++) { var distanceX = Math.Abs(i - MaxRange); var distanceY = Math.Abs(j - MaxRange); array[i, j] = distanceX <= MaxRange && distanceY <= MaxRange && (distanceX >= MinRange || distanceY >= MinRange); } } if (PlayConditions.Contains(PlayCondition.straightLine)) { array = BattleManager.ANDArray(array, FillLineArray(MaxRange, true)); } return(array); }