#ifndef TOWN_H #define TOWN_H #include #include #include // #include "city_grid.h" class MeshItemList: public Reference { GDCLASS(MeshItemList, Reference) protected: static void _bind_methods(); private: struct mesh_data { Ref mesh; Array mesh_surfaces; Vector > materials; StringName item_name; }; HashMap item_list; public: void add_item(const StringName &item_name, Ref mesh); void remove_item(const StringName &item_name); const Array &get_item_arrays(const StringName &item_name) const; Ref get_item_mesh(const StringName &item_name) const; }; class GenBuildingSet; class GenRoadSet; class GenCitySet: public Resource { GDCLASS(GenCitySet, Resource) protected: static void _bind_methods(); Ref guildhall_building_set; Ref court_building_set; Ref road_set; Array building_sets; float center_radius; float radius; int min_buildings; int max_buildings; public: void set_guildhall_building_set(const Ref set); Ref get_guildhall_building_set() const; void set_court_building_set(const Ref set); Ref get_court_building_set() const; void set_road_set(const Ref set); Ref get_road_set() const; void set_building_sets(const Array &sets); const Array &get_building_sets() const; void set_center_radius(float radius); float get_center_radius() const; void set_radius(float radius); float get_radius() const; void set_min_buildings(int minb); int get_min_buildings() const; void set_max_buildings(int maxb); int get_max_buildings() const; void _set_data(const Dictionary &data); Dictionary _get_data() const; Dictionary get_items() const; }; class GenExteriorSet: public Resource { GDCLASS(GenExteriorSet, Resource) protected: HashMap > _data; HashMap xmap; bool _set(const StringName &name, const Variant &property); bool _get(const StringName &name, Variant &property) const; void _get_property_list(List *p_list) const; public: GenExteriorSet(); }; class GenInteriorSet: public Resource { GDCLASS(GenInteriorSet, Resource) protected: HashMap > _data; HashMap xmap; bool _set(const StringName &name, const Variant &property); bool _get(const StringName &name, Variant &property) const; void _get_property_list(List *p_list) const; public: GenInteriorSet(); }; class GenFurnitureSet: public Resource { GDCLASS(GenFurnitureSet, Resource) }; class GenBuildingSet: public Resource { GDCLASS(GenBuildingSet, Resource) protected: HashMap _datai; HashMap _datas; HashMap _dataf; HashMap > _datar; bool _set(const StringName &name, const Variant &property); bool _get(const StringName &name, Variant &property) const; void _get_property_list(List *p_list) const; public: GenBuildingSet(); }; class GenRoadSet: public Resource { GDCLASS(GenRoadSet, Resource) protected: HashMap > _data; float segment_length, segment_width, short_segment_length, turn_angle, turn_angle2; bool _set(const StringName &name, const Variant &property); bool _get(const StringName &name, Variant &property) const; void _get_property_list(List *p_list) const; public: GenRoadSet(); }; #endif