battle-engine.js
/**
	 * Takes a choice string passed from the client. Starts the next
	 * turn if all required choices have been made.
	 */
Takes a choice string passed from the client. Starts the next
turn if all required choices have been made.
Takes a choice string passed from the client . Starts the next turn if all required choices have been made .
choose(sideid, input) {
		let side = null;
		if (sideid === 'p1' || sideid === 'p2') side = this[sideid];
		if (!side) throw new Error(`Invalid side ${sideid}`);
		if (!side.choose(input)) return false;
		this.checkDecisions();
		return true;
	}
choose ( sideid , input ) { let side = null ; if ( sideid === 'p1' || sideid === 'p2' ) side = this [ sideid ] ; if ( ! side ) throw new Error ( ` ${ sideid } ` ) ; if ( ! side . choose ( input ) ) return false ; this . checkDecisions ( ) ; return true ; }
Takes a choice string passed from the client.
Takes a choice string passed from the client .