MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / constructor

Method constructor

src/actions/HideCharacter.ts:17–39  ·  view source on GitHub ↗
([hide, type, asset, ...classes]: string[])

Source from the content-addressed store, hash-verified

15 classes: string[];
16
17 constructor([hide, type, asset, ...classes]: string[]) {
18 super();
19 this.asset = asset;
20
21 if (typeof this.engine.character(this.asset) !== 'undefined') {
22 this.element = this.engine.element().find(`[data-character="${this.asset}"]`).last();
23 } else {
24 FancyError.show('action:hide_character:character_not_found', {
25 asset: this.asset,
26 availableCharacters: Object.keys(this.engine.characters()),
27 statement: `<code class='language=javascript'>"${this._statement}"</code>`,
28 label: this.engine.state('label'),
29 step: this.engine.state('step')
30 });
31 }
32
33 if (typeof classes !== 'undefined') {
34 this.classes = classes;
35 } else {
36 this.classes = [];
37 }
38 this.classes = this.classes.filter((c) => (c !== 'at' && c !== 'with'));
39 }
40
41 override async willApply(): Promise<void> {
42

Callers

nothing calls this directly

Calls 6

characterMethod · 0.80
charactersMethod · 0.80
stateMethod · 0.80
keysMethod · 0.65
elementMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected