s_node.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. Minetest
  3. Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #pragma once
  17. #include "irr_v3d.h"
  18. #include "cpp_api/s_base.h"
  19. #include "cpp_api/s_nodemeta.h"
  20. #include "util/string.h"
  21. struct MapNode;
  22. class ServerActiveObject;
  23. class ScriptApiNode
  24. : virtual public ScriptApiBase,
  25. public ScriptApiNodemeta
  26. {
  27. public:
  28. ScriptApiNode() = default;
  29. virtual ~ScriptApiNode() = default;
  30. bool node_on_punch(v3s16 p, MapNode node,
  31. ServerActiveObject *puncher, const PointedThing &pointed);
  32. bool node_on_dig(v3s16 p, MapNode node,
  33. ServerActiveObject *digger);
  34. void node_on_construct(v3s16 p, MapNode node);
  35. void node_on_destruct(v3s16 p, MapNode node);
  36. bool node_on_flood(v3s16 p, MapNode node, MapNode newnode);
  37. void node_after_destruct(v3s16 p, MapNode node);
  38. bool node_on_timer(v3s16 p, MapNode node, f32 dtime);
  39. void node_on_receive_fields(v3s16 p,
  40. const std::string &formname,
  41. const StringMap &fields,
  42. ServerActiveObject *sender);
  43. public:
  44. static struct EnumString es_DrawType[];
  45. static struct EnumString es_ContentParamType[];
  46. static struct EnumString es_ContentParamType2[];
  47. static struct EnumString es_LiquidType[];
  48. static struct EnumString es_LiquidMoveType[];
  49. static struct EnumString es_NodeBoxType[];
  50. static struct EnumString es_TextureAlphaMode[];
  51. };