Add: TypingTextManager
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
class TypingTextManager {
|
||||
|
||||
constructor() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
this.contents = [];
|
||||
}
|
||||
|
||||
getContents() {
|
||||
return this.contents;
|
||||
}
|
||||
|
||||
add(arr) {
|
||||
this.contents = this.contents.concat(arr);
|
||||
}
|
||||
|
||||
slice(start, end) {
|
||||
this.contents = this.contents.slice(start, end);
|
||||
}
|
||||
|
||||
getShuffledArray(arr) {
|
||||
return Phaser.ArrayUtils.shuffle(arr);
|
||||
}
|
||||
|
||||
|
||||
makePracticeContents(arr, repeatCount) {
|
||||
this.init();
|
||||
this.add(arr);
|
||||
for(let i = 0; i < repeatCount; i++) {
|
||||
this.add(this.getShuffledArray(arr));
|
||||
}
|
||||
}
|
||||
|
||||
makeTestContents(arr) {
|
||||
this.init();
|
||||
this.add(this.getShuffledArray(arr));
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user