PreviousState.js 779 B

123456789101112131415161718192021222324252627282930313233
  1. function PreviousState() {
  2. this.type=null;
  3. //当前活动的墙
  4. this.currentWallId=null;
  5. this.currentStairId=null;
  6. //选中的线段所在位置的起始点
  7. //选中点的位置
  8. this.currentstartlinePointIndex;
  9. //选中的线段所在位置的终点
  10. this.currentendlinePointIndex;
  11. };
  12. PreviousState.prototype.save=function(state)
  13. {
  14. if(state.selectWallSet!=null)
  15. {
  16. this.type=state.selectWallSet.type;
  17. this.currentWallId=state.currentWallId;
  18. }
  19. else if(state.selectStairSet!=null)
  20. {
  21. this.type=state.selectStairSet.type;
  22. this.currentStairId=state.currentStairId;
  23. }
  24. else
  25. {
  26. this.type=null;
  27. this.currentStairId=null;
  28. this.currentWallId=null;
  29. }
  30. this.currentstartlinePointIndex=state.currentstartlinePointIndex;
  31. this.currentendlinePointIndex=state.currentendlinePointIndex;
  32. };