hunt(hType) {
      // console.log('type = '+ hType);
      if (hType == 'split') {
          if (hm.nodes[this.currentNode].hunter == 2 && hm.nodes[this.currentNode].boar < 3) {
              // call move function 
              this.move();
              return;
          }

          if (this.stamina < 2) {
              this.resetStamina();
              return;
          }

          this.stamina -= 2;

          if (hm.nodes[this.currentNode].boar == 1) {
              this.prey++;
              hm.nodes[this.currentNode].boar--;
              return
          }

          this.prey += 2;
          hm.nodes[this.currentNode].boar -= 2;
          return;

      } else if (hType == 'group') {
          this.stamina--;
          this.prey++;
          hm.nodes[this.currentNode].boar--;
          return;
      } else {
          throw "not allowed !";
      }
  }
/**
   * hunt function:
   * will be able to play split or togather 
   * check if type of hunt is split or togather hunter then process 
   */
hunt function:
will be able to play split or togather
check if type of hunt is split or togather hunter then process
hunt function : will be able to play split or togather check if type of hunt is split or togather hunter then process
hunt(hType) {
      if (hType == 'split') {
          if (hm.nodes[this.currentNode].hunter == 2 && hm.nodes[this.currentNode].boar < 3) {
              this.move();
              return;
          }
          if (this.stamina < 2) {
              this.resetStamina();
              return;
          }
          this.stamina -= 2;
          if (hm.nodes[this.currentNode].boar == 1) {
              this.prey++;
              hm.nodes[this.currentNode].boar--;
              return
          }
          this.prey += 2;
          hm.nodes[this.currentNode].boar -= 2;
          return;
      } else if (hType == 'group') {
          this.stamina--;
          this.prey++;
          hm.nodes[this.currentNode].boar--;
          return;
      } else {
          throw "not allowed !";
      }
  }
hunt ( hType ) { if ( hType == 'split' ) { if ( hm . nodes [ this . currentNode ] . hunter == 2 && hm . nodes [ this . currentNode ] . boar < 3 ) { this . move ( ) ; return ; } if ( this . stamina < 2 ) { this . resetStamina ( ) ; return ; } this . stamina -= 2 ; if ( hm . nodes [ this . currentNode ] . boar == 1 ) { this . prey ++ ; hm . nodes [ this . currentNode ] . boar -- ; return } this . prey += 2 ; hm . nodes [ this . currentNode ] . boar -= 2 ; return ; } else if ( hType == 'group' ) { this . stamina -- ; this . prey ++ ; hm . nodes [ this . currentNode ] . boar -- ; return ; } else { throw "not allowed !" ; } }
hunt function:
 will be able to play split or togather
 check if type of hunt is split or togather hunter then process
hunt function : will be able to play split or togather check if type of hunt is split or togather hunter then process
// console.log('type = '+ hType); // call move function 