How to use the dotaconstants.lane_role function in dotaconstants

To help you get started, we’ve selected a few dotaconstants 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 odota / core / util / analysis.js View on Github external
{
          return 5 - raw;
        },
        top: 0,
      };
    },
  };
  for (const key in checks)
    {
    advice[key] = checks[key](match, pm);
    const val = advice[key];
    val.display = util.format('%s: <b>%s</b>, expected <b>%s</b>', val.name, Number(val.value ? val.value.toFixed(2) : ''), Number(val.top.toFixed(2)));
    val.display += (val.suffix ? ` ${val.suffix}` : '');
    val.pct = val.score(val.value) / val.score(val.top);
    delete val.score;
    pm.desc = [constants.lane_role[pm.lane_role], isSupport(pm) ? 'Support' : 'Core'].join('/');
  }
  return advice;

  function isSupport(pm)
    {
    return getObsWardsPlaced(pm) &gt;= 2 &amp;&amp; pm.lh_t &amp;&amp; pm.lh_t[10] &lt; 20;
  }

  function getObsWardsPlaced(pm)
    {
    if (!pm.obs_log)
        {
      return 0;
    }
    return pm.obs_log.filter((l) =&gt; {
      return !l.entityleft;