-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreaders-item.class.js
42 lines (38 loc) · 1.42 KB
/
readers-item.class.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//=============================================================================
//
// File: /node_modules/rwt-reading-points/readers-item.class.js
// Language: ECMAScript 2015
// Copyright: Read Write Tools © 2020
// License: MIT
// Initial date: Jan 15, 2019
// Contents: An object representing a single page
//
//=============================================================================
export default class ReadersItem {
constructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
if (arg0.constructor.name == 'Object')
this.copyConstructor(arg0);
else
this.normalConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6 );
}
copyConstructor(rhs) {
this.title = rhs.title;
this.skillCategory = rhs.skillCategory;
this.skillLevel = rhs.skillLevel;
this.skillPoints = rhs.skillPoints;
this.suggestedReadingTime = rhs.suggestedReadingTime;
this.percentRead = rhs.percentRead;
this.readingTime = rhs.readingTime;
Object.seal(this);
}
normalConstructor(title, skillCategory, skillLevel, skillPoints, suggestedReadingTime, percentRead, readingTime) {
this.title = title;
this.skillCategory = skillCategory;
this.skillLevel = skillLevel;
this.skillPoints = skillPoints;
this.suggestedReadingTime = suggestedReadingTime;
this.percentRead = percentRead; // 0.0 to 1.0
this.readingTime = readingTime; // integer time in seconds
Object.seal(this);
}
}