.. _program_listing_file_src_honeycomb_honeycomb_cell.h: Program Listing for File honeycomb_cell.h ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/honeycomb/honeycomb_cell.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include // for int32_t #include "core/hex_mesh.h" // for HexMesh, HexMeshParams #include "core/tile_mesh.h" // for TileMesh #include "misc/types.h" // for GroupedMeshVertices #include "tal/camera.h" // for Camera3D #include "tal/event.h" // for InputEvent #include "tal/material.h" // for ShaderMaterial #include "tal/noise.h" // for FastNoiseLite #include "tal/reference.h" // for Ref #include "tal/vector3.h" // for Vector3 namespace sota { class Hexagon; struct HoneycombCellMeshParams { HexMeshParams hex_mesh_params; Ref noise{nullptr}; Ref selection_material{nullptr}; }; class HoneycombCell : public TileMesh { GDCLASS(HoneycombCell, TileMesh) public: HoneycombCell() = default; // existence is 'must' for Godot HoneycombCell(const HoneycombCell& other) = delete; HoneycombCell(HoneycombCell&& other) = delete; // copying operator= defined inside GDCLASS HoneycombCell& operator=(HoneycombCell&& rhs) = delete; // getters int get_id() override { return _hex_mesh->get_id(); } // setters void set_noise(Ref noise); void set_selection_material(Ref p_selection_material); void calculate_heights(float bottom_offset); HexMesh* inner_mesh() const override { return _hex_mesh.ptr(); } HoneycombCell(Hexagon hex, HoneycombCellMeshParams params); protected: static void _bind_methods(); private: Ref _noise; Ref _selection_material; Ref _hex_mesh; void handle_mouse_entered(); void handle_mouse_exited(); void handle_input_event(Camera3D* p_camera, const Ref& p_event, const Vector3& p_event_position, const Vector3& p_normal, int32_t p_shape_idx); }; } // namespace sota