FieldScriptFormatter.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <map>
  17. #include <vector>
  18. #include <string>
  19. #include "decompiler/ScriptFormatter.h"
  20. /**
  21. * Formatter for field scripts.
  22. */
  23. class FieldScriptFormatter: public ScriptFormatter{
  24. public:
  25. /**
  26. * Adds an spawn point.
  27. *
  28. * If the spawn is new, a new record will be added to the spawn point
  29. * database. If it was already there, update the record to add the
  30. * origin.
  31. *
  32. * @param map_id[in] The target map ID.
  33. * @param entity[in] The entity that acts as the spawn point.
  34. * @param function_name[in] The spawn function name.
  35. * @param address[in] @todo Understand and document.
  36. * @param x[in] X coordinate of the field at which to spawn.
  37. * @param y[in] Y coordinate of the field at which to spawn.
  38. * @param z[in] Z coordinate of the field at which to spawn.
  39. * @param angle[in] Orientation at which to spawn.
  40. */
  41. virtual void AddSpawnPoint(
  42. unsigned int map_id, const std::string& entity, const std::string& function_name,
  43. unsigned int address, int x, int y, int triangle_id, int angle
  44. );
  45. /**
  46. * Retrieves the name of a spawn point.
  47. *
  48. * @param map_id[in] The target map ID.
  49. * @param entity[in] The entity that acts as the spawn point.
  50. * @param function_name[in] The spawn function name.
  51. * @param address[in] @todo Understand and document.
  52. * @return The name of the spawn point.
  53. */
  54. virtual std::string GetSpawnPointName(
  55. unsigned int map_id, const std::string& entity,
  56. const std::string& function_name, unsigned int address
  57. );
  58. /**
  59. * Retrieves the name of a map.
  60. *
  61. * The name of a map is usually it's ID.
  62. *
  63. * @param map_id[in] The map ID.
  64. * @return The map name.
  65. */
  66. virtual std::string GetMapName(unsigned int map_id);
  67. };