{"size": 602, "ext": "js", "max_stars_repo_path": "frontend/src/game/gameBoard/static.js", "max_stars_repo_name": "WinterLicht/roboRace", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/src/game/gameBoard/static.js", "max_issues_repo_name": "WinterLicht/roboRace", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/src/game/gameBoard/static.js", "max_forks_repo_name": "WinterLicht/roboRace", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.6842105263, "max_line_length": 97, "alphanum_fraction": 0.6362126246}
const _ = require('lodash')
const h = require('snabbdom/h').default
const svg = require('./svg')

function renderScenario(scenario, tileClickListener) {
  const height = svg.height(scenario)
  const width = svg.width(scenario)
  return h('div.game-board',
    h('svg', {attrs: {xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}`}}, [
      h('g', svg.tiles(scenario, tileClickListener)),
      h('g', svg.walls(scenario)),
      h('g', svg.target(scenario)),
      h('g', svg.traps(scenario)),
      h('g', svg.startingPoints(scenario))
    ]))
}

module.exports = {renderScenario}
