sim/battle.js
/**
	 * @return true if both decisions are complete
	 */
@return true if both decisions are complete
@return true if both decisions are complete
checkDecisions() {
		let totalDecisions = 0;
		if (this.p1.isChoiceDone()) {
			if (!this.supportCancel) this.p1.choice.cantUndo = true;
			totalDecisions++;
		}
		if (this.p2.isChoiceDone()) {
			if (!this.supportCancel) this.p2.choice.cantUndo = true;
			totalDecisions++;
		}
		if (totalDecisions >= this.sides.length) {
			this.commitDecisions();
			return true;
		}
		return false;
	}
checkDecisions ( ) { let totalDecisions = 0 ; if ( this . p1 . isChoiceDone ( ) ) { if ( ! this . supportCancel ) this . p1 . choice . cantUndo = true ; totalDecisions ++ ; } if ( this . p2 . isChoiceDone ( ) ) { if ( ! this . supportCancel ) this . p2 . choice . cantUndo = true ; totalDecisions ++ ; } if ( totalDecisions >= this . sides . length ) { this . commitDecisions ( ) ; return true ; } return false ; }
@return true if both decisions are complete
@return true if both decisions are complete