function PreviousState() { this.type=null; //当前活动的墙 this.currentWallId=null; this.currentStairId=null; //选中的线段所在位置的起始点 //选中点的位置 this.currentstartlinePointIndex; //选中的线段所在位置的终点 this.currentendlinePointIndex; }; PreviousState.prototype.save=function(state) { if(state.selectWallSet!=null) { this.type=state.selectWallSet.type; this.currentWallId=state.currentWallId; } else if(state.selectStairSet!=null) { this.type=state.selectStairSet.type; this.currentStairId=state.currentStairId; } else { this.type=null; this.currentStairId=null; this.currentWallId=null; } this.currentstartlinePointIndex=state.currentstartlinePointIndex; this.currentendlinePointIndex=state.currentendlinePointIndex; };