How to use the oni-save-parser.AI_EFFECT_IDS.map function in oni-save-parser

To help you get started, we’ve selected a few oni-save-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RoboPhred / oni-duplicity / src / pages / SaveEditor / components / editors / game-objects / MinionEditor / components / MinionEffectsTab / MinionEffectsTab.tsx View on Github external
render() {
    const { effects, onSetEffectData } = this.props;

    if (!effects) {
      return (
        
          No effects data could be found on this duplicant.
        
      );
    }

    const data = AI_EFFECT_IDS.map(effectId => {
      const effectIndex = effects.findIndex(x => x.id === effectId);
      const effect = effectIndex > -1 ? effects[effectIndex] : null;
      return {
        effectId,
        effectIndex,
        timeRemaining: effect ? effect.timeRemaining : null
      };
    });

    const columns: DataTableColumn[] = [
      {
        Header: "Effect",
        sortable: true,
        filterable: true,
        accessor: "effectId"
      },