AStarStep.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var AStarStep = cc.Class({
  2. name: "AStarStep",
  3. properties: () => ({
  4. id_col: {
  5. default: 0,
  6. type: cc.Integer
  7. },
  8. getcol: {
  9. get: function() {
  10. return this.id_col;
  11. }
  12. },
  13. id_row: {
  14. default: 0,
  15. type: cc.Integer
  16. },
  17. getrow: {
  18. get: function() {
  19. return this.id_row;
  20. }
  21. },
  22. getg: {
  23. get: function() {
  24. return this.id_g;
  25. }
  26. },
  27. geth: {
  28. get: function() {
  29. return this.id_h;
  30. }
  31. },
  32. getf: {
  33. get: function() {
  34. return this.id_f;
  35. }
  36. },
  37. getfid: {
  38. get: function() {
  39. return this.id_fid;
  40. }
  41. },
  42. }),
  43. //int col,int row
  44. setpos(col,row)
  45. {
  46. this.id_col = col;
  47. this.id_row = row;
  48. },
  49. //int g
  50. setg(g)
  51. {
  52. this.id_g = g;
  53. },
  54. //int h
  55. seth(h)
  56. {
  57. this.id_h = h;
  58. },
  59. //int fid
  60. setfid(fid)
  61. {
  62. this.id_fid = fid;
  63. },
  64. //int f
  65. setf(f)
  66. {
  67. this.id_f = f;
  68. }
  69. });
  70. module.exports = AStarStep;