UIService.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import Text from "../Geometry/Text.js";
  2. import { dataService } from "./DataService.js";
  3. import { mathUtil } from "../Util/MathUtil.js";
  4. import Setting from "../Setting";
  5. export default class UIService {
  6. constructor() {}
  7. isBelongRoad(ui) {
  8. if (ui == "OneEdgeOneLanRoad") {
  9. this.setRoadLeftDrivewayCount(0);
  10. this.setRoadRightDrivewayCount(0);
  11. return true;
  12. } else if (ui == "OneEdgeTwoLanRoad") {
  13. this.setRoadLeftDrivewayCount(0);
  14. this.setRoadRightDrivewayCount(0);
  15. return true;
  16. } else if (ui == "OneEdgeThreeLanRoad") {
  17. this.setRoadLeftDrivewayCount(0);
  18. this.setRoadRightDrivewayCount(0);
  19. return true;
  20. } else if (ui == "TwoEdgeOneLanRoad") {
  21. this.setRoadLeftDrivewayCount(1);
  22. this.setRoadRightDrivewayCount(1);
  23. return true;
  24. } else if (ui == "TwoEdgeTwoLanRoad") {
  25. this.setRoadLeftDrivewayCount(2);
  26. this.setRoadRightDrivewayCount(2);
  27. return true;
  28. } else if (ui == "TwoEdgeThreeLanRoad") {
  29. this.setRoadLeftDrivewayCount(3);
  30. this.setRoadRightDrivewayCount(3);
  31. return true;
  32. }
  33. return false;
  34. }
  35. isBelongCurveRoad(ui) {
  36. if (ui == "SBend") {
  37. this.setRoadLeftDrivewayCount(0);
  38. this.setRoadRightDrivewayCount(0);
  39. return true;
  40. } else if (ui == "OneEdgeOneLanRoad") {
  41. this.setRoadLeftDrivewayCount(0);
  42. this.setRoadRightDrivewayCount(0);
  43. return true;
  44. }
  45. }
  46. setRoadLeftDrivewayCount(value) {
  47. Setting.roadLeftDrivewayCount = value;
  48. }
  49. setRoadRightDrivewayCount(value) {
  50. Setting.roadRightDrivewayCount = value;
  51. }
  52. setCurveRoadLeftDrivewayCount(value) {
  53. Setting.curveRoadLeftDrivewayCount = value;
  54. }
  55. setCurveRoadRightDrivewayCount(value) {
  56. Setting.curveRoadRightDrivewayCount = value;
  57. }
  58. }
  59. const uiService = new UIService();
  60. export { uiService };