From 2da65e94f71b21fcd026301e6c34efee1cffde85 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Wed, 10 May 2023 22:10:11 -0700 Subject: [PATCH] Make buildRings private. --- src/models/UI.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/models/UI.js b/src/models/UI.js index f3a923f..f4b594f 100644 --- a/src/models/UI.js +++ b/src/models/UI.js @@ -2,81 +2,81 @@ export class UI { constructor() {} /* -------------------------------------------------------------------------- buildRings ---- */ - - static buildRings(body) { + + static #buildRings(body) { const rings = $('') const seperator = $('').text(' ) ') rings.appendChild(seperator) - + body.Rings.forEach((ring) => { const ringClass = ring.RingClass.replace('eRingClass_', '') let icon = null - + switch (ringClass) { case 'MetalRich': { icon = 'gold-bars' break } - + case 'Metalic': case 'Metallic': { icon = 'ingot' break } - + case 'Icy': { icon = 'snowflake' break } - + case 'Rocky': { icon = 'asteroid-3' break } } - + if (icon !== null) { rings.appendChild($('').addClass(`flaticon-${icon}`)) rings.appendChild(seperator) } }) - + return rings } - + /* ----------------------------------------------------------------------- createBodyRow ---- */ static createBodyRow(body) { const chartedStyle = body.WasDiscovered && !body.DSSDone ? 'charted' : 'uncharted' const row = $('
').addClass('row ms-1 me-1') row.attr('id', body.bodyID) - + // spacer row.appendChild($('
').addClass('col-1 system')) - + // name const name = $('
').addClass(`col-2 text-left system ${chartedStyle}`) name.appendChild($('')).addClass(`flaticon-${body.nameIcon()}`) name.appendChild($('')).text(body.simpleName()) row.appendChild(name) - + // type icon const type = $('
').addClass(`col pe-0 me-0 system ${chartedStyle}`) type.appendChild($('').addClass(`flaticon-${body.typeIcon()}`)) // rings if (body.Rings !== undefined) { - type.appendChild(buildRings(body)) + type.appendChild(UI.#buildRings(body)) } // type const typeName = body.PlanetClass || body.starType || '' type.appendChild($('').text(typeName)) row.appendChild(type) - + // distance const distance = $('
').addClass(`col-auto ps-2 ms-0 system ${chartedStyle}`) distance.text(body.distance()) row.appendChild(distance) - + // info const info = $('
').addClass(`col-1 system ${chartedStyle}`) // terraformable @@ -92,11 +92,11 @@ export class UI { } info.appendChild(mapped) row.appendChild(info) - + // mapped value const value = $('
').addClass(`col-2 text-right system ${chartedStyle}`) row.appendChild(value) - + return row } } \ No newline at end of file