@@ -58,7 +58,7 @@ let profiles: ProfilesList = [];
58
58
let source : HTMLImageElement ;
59
59
let size : number ;
60
60
let profNum : number ;
61
- let prof : string ;
61
+ let prof : number ;
62
62
let numNext : number ;
63
63
let start : Room ;
64
64
let end : Room ;
@@ -115,7 +115,7 @@ async function clearAll() {
115
115
window . clearAll = clearAll ;
116
116
117
117
function createProfile ( profNum : number ) {
118
- prof = String ( profNum ) ;
118
+ prof = profNum ;
119
119
const tempElementId = `tempProf${ prof } ` ;
120
120
const tempElementIdNext = `tempProf${ profNum + 1 } ` ;
121
121
// Creates html elements in the courses class.
@@ -158,8 +158,8 @@ function createProfile(profNum: number) {
158
158
<div class="container" id="${ tempElementIdNext } "></div>` ;
159
159
}
160
160
161
- function createCourse ( num : string , profNum : string ) {
162
- numNext = parseInt ( num ) + 1 ;
161
+ function createCourse ( num : number , profNum : number ) {
162
+ numNext = num + 1 ;
163
163
const tempElementId = `temp${ prof } ${ num } ` ;
164
164
const tempElementIdNext = `temp${ prof } ${ numNext } ` ;
165
165
// Creates html elements in the courses class.
@@ -191,7 +191,7 @@ function createCourse(num: string, profNum: string) {
191
191
<span class="containerinpt" id="passing${ num } ${ prof } ">
192
192
<button
193
193
class="purple btninpt showpth"
194
- onclick="passingTime(${ parseInt ( num ) - 1 } , ${ profNum } )"
194
+ onclick="passingTime(${ num - 1 } , ${ profNum } )"
195
195
>
196
196
Show Path
197
197
<span class="big-text"><i class="fa-solid fa-down-long"></i></span>
@@ -213,7 +213,7 @@ async function applySavedProfiles() {
213
213
( document . getElementById ( `nameProf${ i } ` ) as HTMLInputElement ) . value =
214
214
profiles [ 0 ] ! [ i ] ! as string ;
215
215
for ( let f = 1 ; f < profiles [ i ] ! . length + 1 ; f ++ ) {
216
- createCourse ( String ( f ) , String ( i ) ) ;
216
+ createCourse ( f , i ) ;
217
217
(
218
218
document . getElementById ( `rmnum${ f } ${ i } txt` ) as HTMLInputElement
219
219
) . value = profiles [ i ] ! [ f - 1 ] ! [ 0 ] ! ;
@@ -342,22 +342,22 @@ function createCanvas() {
342
342
}
343
343
344
344
function courseLoop ( profNum : number ) {
345
- prof = String ( profNum ) ;
345
+ prof = profNum ;
346
346
coursesAmt =
347
347
parseInt (
348
348
( document . getElementById ( `num${ profNum } ` ) as HTMLInputElement ) . value ,
349
349
) + 1 ;
350
350
if ( ! Number . isNaN ( coursesAmt ) ) {
351
351
for ( let i = 1 ; i < coursesAmt ; i ++ ) {
352
- createCourse ( ` ${ i } ` , prof ) ;
352
+ createCourse ( i , prof ) ;
353
353
}
354
354
document . getElementById ( `passing${ coursesAmt - 1 } ${ prof } ` ) ! . innerHTML = "" ;
355
355
}
356
356
}
357
357
window . courseLoop = courseLoop ;
358
358
359
359
async function locateCourses ( profNum : number ) {
360
- prof = String ( profNum ) ;
360
+ prof = profNum ;
361
361
profiles [ profNum ] = [ ] ;
362
362
if ( profiles [ 0 ] === undefined ) {
363
363
profiles [ 0 ] = [ null , "" ] ;
0 commit comments