Misc bookkeeping and documentation
This commit is contained in:
0
utils/dice.js
Normal file → Executable file
0
utils/dice.js
Normal file → Executable file
0
utils/id.js
Normal file → Executable file
0
utils/id.js
Normal file → Executable file
0
utils/random.js
Normal file → Executable file
0
utils/random.js
Normal file → Executable file
0
utils/regex.js
Normal file → Executable file
0
utils/regex.js
Normal file → Executable file
@@ -8,6 +8,22 @@ export class TileOptions {
|
|||||||
this.args = args;
|
this.args = args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name
|
||||||
|
* @param {Record<string,any>} args
|
||||||
|
*/
|
||||||
|
static fromObject(name, args) {
|
||||||
|
//
|
||||||
|
const result = new TileOptions(name, []);
|
||||||
|
|
||||||
|
for (const [k, v] of Object.entries(args)) {
|
||||||
|
const arg = new TileArgs(k, v);
|
||||||
|
result.args.push(arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find an arg by name, but fall back to an index position
|
* Find an arg by name, but fall back to an index position
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user