SpawnPointDb.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /**
  17. * A database of spawn points.
  18. */
  19. struct SpawnPointDb{
  20. /**
  21. * Field IDs.
  22. *
  23. * ID of the field the gateways records from N other number of fields
  24. * are linking to.
  25. */
  26. u16 target_field_id = 0;
  27. /**
  28. * A spawn point database record.
  29. */
  30. struct Record{
  31. /**
  32. * Field that links to {@see SpawnPointDb::target_field_id}.
  33. */
  34. u16 field_id = 0;
  35. /**
  36. * Index of the gateway in {@see field_id}.
  37. */
  38. u32 gateway_index_or_map_jump_address = 0;
  39. /**
  40. * Gateway data.
  41. */
  42. VGears::TriggersFile::Gateway gateway;
  43. /**
  44. * Indicates if the gateway is a map jump from a script.
  45. */
  46. bool from_script = false;
  47. /**
  48. * @todo Understand and document.
  49. *
  50. * Only used from script calls.
  51. */
  52. std::string entity_name;
  53. /**
  54. * @todo Understand and document.
  55. *
  56. * Only used from script calls.
  57. */
  58. std::string script_function_name;
  59. };
  60. /**
  61. * List of gateways to this field.
  62. */
  63. std::vector<Record> gateways_to_this_field;
  64. };