.. _program_listing_file_src_misc_tile.h: Program Listing for File tile.h =============================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/misc/tile.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include "core/hex_mesh.h" #include "honeycomb/honeycomb_cell.h" #include "honeycomb/honeycomb_honey.h" #include "misc/cube_coordinates.h" #include "misc/types.h" #include "ridge_impl/ridge_mesh.h" #include "tal/mesh.h" #include "tal/node.h" #include "tal/reference.h" namespace sota { class Tile : public Node3D { public: Tile() = delete; virtual ~Tile(); Tile(Ref mesh, Vector3 offset, Node3D* parent, OffsetCoordinates offset_coord); Ref mesh() const; int id() const { return _mesh->get_id(); } bool is_shifted() const { return _shifted; } OffsetCoordinates get_offset_coords() const { return _offset_coord; } CubeCoordinates get_cube_coords() const { return offsetToCube(_offset_coord); } private: Ref _sphere_shaped3d{nullptr}; CollisionShape3D* _collision_shape3d{nullptr}; StaticBody3D* _static_body{nullptr}; MeshInstance3D* _main_mesh_instance{nullptr}; Ref _mesh; OffsetCoordinates _offset_coord; const bool _shifted; // odd rows are shifted by half of small radius }; class BiomeTile : public Tile { public: BiomeTile() = delete; BiomeTile(Ref ridge_hex_mesh, Node3D* parent, Biome biome, OffsetCoordinates offset_coord) : Tile(ridge_hex_mesh, ridge_hex_mesh->get_center(), parent, offset_coord), _biome(biome) {} // getters Biome biome() const; Neighbours neighbours() const; // setters void set_neighbours(Neighbours neighbours); private: Biome _biome; Neighbours _neighbours; }; class HoneycombTile : public Tile { public: HoneycombTile() = delete; HoneycombTile(Ref walls, Ref honey, Node3D* parent, OffsetCoordinates offset_coord); // getters Ref honey_mesh() const; private: Ref _honey; MeshInstance3D* _second_mesh_instance{nullptr}; }; } // namespace sota