Skip to content

Commit

Permalink
document the new SpellSheet class
Browse files Browse the repository at this point in the history
  • Loading branch information
pyanderson committed Nov 11, 2023
1 parent c7bc679 commit 490e55d
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 224 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ npm i
Gere a Documentação:

```bash
npm run make_docs
npm run docs
```

A documentação será gerada na pasta `out`, seguindo o seguinte padrão: `out/roll20_tormenta20_grimoire/{versão-atual}/index.html`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:prod:v2": "MANIFEST=v2 webpack build --mode production",
"lint": "eslint --ext .ts,.js --max-warnings=0 src/",
"prettier": "prettier --write src/",
"make_docs": "jsdoc --package package.json --readme README.md -r src/"
"docs": "jsdoc --package package.json --readme README.md -r src/"
},
"repository": {
"type": "git",
Expand Down
43 changes: 30 additions & 13 deletions src/features/character-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,43 @@ export class CharacterSheet {
this.roll20 = window.Campaign;
/** @type {Object} */
this.character = this.roll20.characters.get(characterId);
// private
this._isJDA = null;
this._spellsContainer = null;
this._powersContainer = null;
this._equipmentsContainer = null;
this._headerContainer = null;
// enhancement
this.character.getAttributes = (filterFn, transformFn = (a) => a) =>
this.character.attribs.models
.filter(filterFn)
.map(transformFn)
.reduce((acc, a) => ({ ...acc, [a.get('name')]: a }), {});
// Other modules
/** @type {SpellSheet} */
this.spellSheet = new SpellSheet(
this.iframe,
this.spellsContainer,
this.db,
this.character,
);
this.spellSheet = new SpellSheet({
iframe: this.iframe,
spells: this.db.spells,
character: this.character,
});
/**
* @type {EnhancedHTMLElement|null}
* @private
*/
this._isJDA = null;
/**
* @type {EnhancedHTMLElement|null}
* @private
*/
this._spellsContainer = null;
/**
* @type {EnhancedHTMLElement|null}
* @private
*/
this._powersContainer = null;
/**
* @type {EnhancedHTMLElement|null}
* @private
*/
this._equipmentsContainer = null;
/**
* @type {EnhancedHTMLElement|null}
* @private
*/
this._headerContainer = null;
}

/** @type {EnhancedHTMLElement|null} */
Expand Down
Loading

0 comments on commit 490e55d

Please sign in to comment.