readFloor static method

List<Pile> readFloor(
  1. GameRef g
)

Read the current floor piles

Implementation

static List<Pile> readFloor(GameRef g) {
  List<Pile> floor = [];
  ffi.Pointer<lib.Pile> data = _core.read_floor(g);
  for (var i = 0; i < FLOOR_SIZE; i++) {
    floor.add(Pile.fromAddress(data.address + (i * ffi.sizeOf<lib.Pile>())));
  }
  malloc.free(data);
  return floor;
}