Changeset View
Changeset View
Standalone View
Standalone View
src/core/Wordlist.qml
Context not available. | |||||
97 | */ | 97 | */ | ||
---|---|---|---|---|---|
98 | signal error(string msg); | 98 | signal error(string msg); | ||
99 | 99 | | |||
100 | /** | ||||
101 | * Load Wordlist from JSON Object. | ||||
102 | * | ||||
103 | * @param type:object levels to load wordlist from. | ||||
104 | */ | ||||
105 | function loadFromJSON(levels) { | ||||
106 | wordList = {levels: levels}; | ||||
107 | maxLevel = wordList.levels.length; | ||||
108 | return wordList; | ||||
jjazeix: I would separate it in an overriden function, both code are totally unrelated | |||||
@jjazeix I created a separate function for loading wordlist from a JSON object as function overloading is not possible in javascript https://www.codeproject.com/Articles/797997/JavaScript-Does-NOT-Support-Method-Overloading-Tha . Is this okay ? AkshayCHD: @jjazeix I created a separate function for loading wordlist from a JSON object as function… | |||||
jjazeix: yes, sure | |||||
109 | } | ||||
110 | | ||||
100 | /** | 111 | /** | ||
101 | * Load Wordlist from file @p fname. | 112 | * Load Wordlist from file @p fname. | ||
102 | * | 113 | * | ||
Context not available. |
I would separate it in an overriden function, both code are totally unrelated