Code coverage report for lib/piece/mobility/leaper.js

Statements: 97.5% (39 / 40)      Branches: 100% (14 / 14)      Functions: 83.33% (5 / 6)      Lines: 97.5% (39 / 40)      Ignored: none     

All files » lib/piece/mobility/ » leaper.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75  1   1       1 1     1 8525   1 1   448                 448 3682 18112   448 448 448   448 448 448   1233 1233   846 846 846   846 846 846   4080 4080   3295 3295 3295   3295 3295   3234 3234 3234   387               1 8525    
"use strict";
Object.defineProperties(exports, {
  Leaper: {get: function() {
      return Leaper;
    }},
  __esModule: {value: true}
});
var Point = require('../../point').Point;
var $__1 = require('../mobility'),
    Mobility = $__1.Mobility,
    quadrants = $__1.quadrants;
var LeaperMobility = function LeaperMobility() {
  $traceurRuntime.defaultSuperCall(this, $LeaperMobility.prototype, arguments);
};
var $LeaperMobility = LeaperMobility;
($traceurRuntime.createClass)(LeaperMobility, {
  adjacentPoints: $traceurRuntime.initGeneratorFunction(function $__8(position, p0) {
    var $__7,
        m,
        n,
        $__5,
        $__6,
        o,
        $__3,
        $__4,
        p1;
    return $traceurRuntime.createGeneratorInstance(function($ctx) {
      while (true)
        switch ($ctx.state) {
          case 0:
            $__7 = this, m = $__7.m, n = $__7.n;
            $ctx.state = 14;
            break;
          case 14:
            $__5 = [new Point(m, n), new Point(n, m)][$traceurRuntime.toProperty(Symbol.iterator)]();
            $ctx.state = 7;
            break;
          case 7:
            $ctx.state = (!($__6 = $__5.next()).done) ? 9 : -2;
            break;
          case 9:
            o = $__6.value;
            $ctx.state = 10;
            break;
          case 10:
            $__3 = quadrants[$traceurRuntime.toProperty(Symbol.iterator)]();
            $ctx.state = 4;
            break;
          case 4:
            $ctx.state = (!($__4 = $__3.next()).done) ? 5 : 7;
            break;
          case 5:
            p1 = $__4.value;
            $ctx.state = 6;
            break;
          case 6:
            $ctx.state = 2;
            return p0.sum(p1.product(o));
          case 2:
            $ctx.maybeThrow();
            $ctx.state = 4;
            break;
          default:
            return $ctx.end();
        }
    }, $__8, this);
  }),
  toString: function() {
    return ("(" + this.scope + ") leaper");
  }
}, {}, Mobility);
function Leaper(m, n) {
  this.mobility.push(new LeaperMobility(m, n));
}