PathManager.js 976 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import MotionType from "./enum/MotionType.js"
  2. export default class PathManager {
  3. constructor() {
  4. this.currentArea = ''
  5. this.currentPathName = ''
  6. this.currentAttitude = ''
  7. this.speed = 0
  8. }
  9. getSpeed(e) {
  10. const t = {
  11. guangchang: {
  12. [MotionType.Walk]: 17,
  13. [MotionType.Run]: 51
  14. },
  15. tower: {
  16. [MotionType.Walk]: 12.5,
  17. [MotionType.Run]: 25
  18. },
  19. zhiboting: {
  20. [MotionType.Walk]: 12.5,
  21. [MotionType.Run]: 25
  22. },
  23. youxiting: {
  24. [MotionType.Walk]: 12.5,
  25. [MotionType.Run]: 25
  26. },
  27. diqing: {
  28. [MotionType.Walk]: 12.5,
  29. [MotionType.Run]: 25
  30. }
  31. }
  32. , r = t[this.currentArea] || t.guangchang;
  33. return this.speed = r[e] * 30,
  34. this.speed
  35. }
  36. }