packages/warriorjs-core/src/loadLevel.js
function loadLevel(
  {
    number,
    description,
    tip,
    clue,
    floor: { size, stairs, warrior, units = [] },
  },
  playerCode,
) {
  const { width, height } = size;
  const stairsLocation = [stairs.x, stairs.y];
  const floor = new Floor(width, height, stairsLocation);

  loadWarrior(warrior, floor, playerCode);
  units.forEach(unit => loadUnit(unit, floor));

  return new Level(number, description, tip, clue, floor);
}
function loadLevel(
  {
    number,
    description,
    tip,
    clue,
    floor: { size, stairs, warrior, units = [] },
  },
  playerCode,
) {
  const { width, height } = size;
  const stairsLocation = [stairs.x, stairs.y];
  const floor = new Floor(width, height, stairsLocation);

  loadWarrior(warrior, floor, playerCode);
  units.forEach(unit => loadUnit(unit, floor));

  return new Level(number, description, tip, clue, floor);
}
function loadLevel ( { number , description , tip , clue , floor : { size , stairs , warrior , units = [ ] } , } , playerCode , ) { const { width , height } = size ; const stairsLocation = [ stairs . x , stairs . y ] ; const floor = new Floor ( width , height , stairsLocation ) ; loadWarrior ( warrior , floor , playerCode ) ; units . forEach ( unit => loadUnit ( unit , floor ) ) ; return new Level ( number , description , tip , clue , floor ) ; }
Loads a level from a level config.

@param {Object} levelConfig The config of the level.
@param {string} [playerCode] The code of the player.

@returns {Level} The loaded level.
Loads a level from a level config .