spawnDeck method

bool spawnDeck(
  1. ItemLocation location,
  2. GlobalVectorDefinition cell, [
  3. bool force = true
])

Implementation

bool spawnDeck(ItemLocation location, GlobalVectorDefinition cell,
    [bool force = true]) {
  final definition = assetManager.getDeck(location);
  if (definition == null) return false;
  final boardSpawn = BoardsSpawnRequest(cell.table);
  for (final board in definition.boards) {
    boardSpawn.board(cell.position + board.position,
        ItemLocation.fromString(board.name, location.namespace));
  }
  final objectSpawn = ObjectsSpawned(cell.table);
  for (final object in definition.figures) {
    objectSpawn.objectWithLocation(
      object.position + cell.position,
      ItemLocation.fromString(object.name, location.namespace),
      variation: object.variation,
    );
  }
  process(boardSpawn, force);
  process(objectSpawn, force);
  return true;
}