code: function(newval){
  		if(this.playeronly){ return;}
  		if(typeof newval==='string'){
  			newval = {edit:1, play:3}[newval.substr(0,4)];
  			if(newval===void 0){ return;}
  		}
  		this.editmode = (newval===this.MODE_EDITOR);
  		this.playmode = !this.editmode;
  
  		if(!!this.klass){
  			this.cursor.adjust_modechange();
  			this.key.keyreset();
  			this.mouse.modechange();
  			this.board.errclear();
  			this.redraw();
  		}
  
  		this.emit('config', 'mode', newval);
  		this.emit('mode');
  	}
docs: ------------------------------------------------------------------------------ owner.setMode() モード変更時の処理を行う ------------------------------------------------------------------------------