int? indexOfOpt(Position position) { if (!area.contains(position)) return null; return indexOf(position.x, position.y); }