readHands static method

List<Card> readHands(
  1. GameRef g
)

Read both player's hands, the current player's first

Implementation

static List<Card> readHands(GameRef g) {
  List<Card> hands = [];
  ffi.Pointer<ffi.Uint8> data = _core.read_hands(g);
  for (var i = 0; i < HAND_SIZE * 2; i++) {
    hands.add(Card.fromAddress(data.address + (i * ffi.sizeOf<ffi.Uint8>())));
  }
  malloc.free(data);
  return hands;
}