logo

libbulletml

Library of Bullet Markup Language (forked from https://shinh.skr.jp/libbulletml/index_en.html )git clone https://hacktivis.me/git/libbulletml.git

bulletml_d.cpp (4306B)


  1. #include "d_cpp_interface.h"
  2. #include "bulletmlparser.h"
  3. #include "bulletmlparser-tinyxml.h"
  4. #include "bulletmlrunner.h"
  5. // BulletMLParserTinyXML
  6. extern "C" {
  7. D_CPP_CLASS(BulletMLParserTinyXML, BulletMLParserTinyXML)
  8. D_CPP_NEW_1(BulletMLParserTinyXML, BulletMLParserTinyXML_new, const char*)
  9. D_CPP_METHOD_0(BulletMLParserTinyXML, parse, BulletMLParserTinyXML_parse, void)
  10. D_CPP_DELETE(BulletMLParserTinyXML, BulletMLParserTinyXML_delete)
  11. }
  12. // BulletMLParser
  13. extern "C" {
  14. D_CPP_CLASS(BulletMLParser, BulletMLParser)
  15. }
  16. // BulletMLState
  17. extern "C" {
  18. D_CPP_CLASS(BulletMLState, BulletMLState)
  19. }
  20. // BulletMLRunner virtual functions
  21. D_CPP_BASE_CLASS_OPEN(BulletMLRunner, BulletMLRunnerD)
  22. BulletMLRunnerD(BulletMLParser* p) : BulletMLRunner(p), D_getRand_fp(0) {}
  23. BulletMLRunnerD(BulletMLState* s) : BulletMLRunner(s), D_getRand_fp(0) {}
  24. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletDirection, double)
  25. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getAimDirection, double)
  26. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletSpeed, double)
  27. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getDefaultSpeed, double)
  28. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getRank, double)
  29. D_CPP_VIRTUAL_METHOD_2(BulletMLRunnerD, createSimpleBullet, void, double, double)
  30. D_CPP_VIRTUAL_METHOD_3(BulletMLRunnerD, createBullet, void, BulletMLState*, double, double)
  31. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getTurn, int)
  32. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, doVanish, void)
  33. D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doChangeDirection, void, double)
  34. D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doChangeSpeed, void, double)
  35. D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doAccelX, void, double)
  36. D_CPP_VIRTUAL_METHOD_1(BulletMLRunnerD, doAccelY, void, double)
  37. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletSpeedX, double)
  38. D_CPP_VIRTUAL_METHOD_0(BulletMLRunnerD, getBulletSpeedY, double)
  39. double (*D_getRand_fp) (BulletMLRunnerD*);
  40. virtual double getRand() {
  41. if (D_getRand_fp) {
  42. return D_getRand_fp(this);
  43. }
  44. else {
  45. return BulletMLRunner::getRand();
  46. }
  47. }
  48. void D_set_getRand(double (*fp) (BulletMLRunnerD*)) {
  49. D_getRand_fp = fp;
  50. }
  51. D_CPP_BASE_CLASS_CLOSE()
  52. // BulletMLRunner
  53. extern "C" {
  54. D_CPP_CLASS(BulletMLRunner, BulletMLRunner)
  55. D_CPP_CLASS(BulletMLRunnerD, BulletMLRunnerD)
  56. D_CPP_NEW_1(BulletMLRunnerD, BulletMLRunner_new_parser, BulletMLParser*)
  57. D_CPP_NEW_1(BulletMLRunnerD, BulletMLRunner_new_state, BulletMLState*)
  58. D_CPP_DELETE(BulletMLRunnerD, BulletMLRunner_delete)
  59. D_CPP_METHOD_0(BulletMLRunnerD, run, BulletMLRunner_run, void)
  60. D_CPP_METHOD_0(BulletMLRunnerD, isEnd, BulletMLRunner_isEnd, bool)
  61. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletDirection, BulletMLRunner_set_getBulletDirection, double)
  62. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getAimDirection, BulletMLRunner_set_getAimDirection, double)
  63. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletSpeed, BulletMLRunner_set_getBulletSpeed, double)
  64. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getDefaultSpeed, BulletMLRunner_set_getDefaultSpeed, double)
  65. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getRank, BulletMLRunner_set_getRank, double)
  66. D_CPP_VIRTUAL_METHOD_SETTER_2(BulletMLRunnerD, createSimpleBullet, BulletMLRunner_set_createSimpleBullet, void, double, double)
  67. D_CPP_VIRTUAL_METHOD_SETTER_3(BulletMLRunnerD, createBullet, BulletMLRunner_set_createBullet, void, BulletMLState*, double, double)
  68. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getTurn, BulletMLRunner_set_getTurn, int)
  69. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, doVanish, BulletMLRunner_set_doVanish, void)
  70. D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doChangeDirection, BulletMLRunner_set_doChangeDirection, void, double)
  71. D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doChangeSpeed, BulletMLRunner_set_doChangeSpeed, void, double)
  72. D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doAccelX, BulletMLRunner_set_doAccelX, void, double)
  73. D_CPP_VIRTUAL_METHOD_SETTER_1(BulletMLRunnerD, doAccelY, BulletMLRunner_set_doAccelY, void, double)
  74. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletSpeedX, BulletMLRunner_set_getBulletSpeedX, double)
  75. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getBulletSpeedY, BulletMLRunner_set_getBulletSpeedY, double)
  76. D_CPP_VIRTUAL_METHOD_SETTER_0(BulletMLRunnerD, getRand, BulletMLRunner_set_getRand, double)
  77. }