MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _set

Method _set

scene/2d/tile_map.cpp:694–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

692#endif // DEBUG_ENABLED
693
694bool TileMap::_set(const StringName &p_name, const Variant &p_value) {
695 int index;
696 const String sname = p_name;
697
698 Vector<String> components = String(p_name).split("/", true, 2);
699 if (sname == "format") {
700 if (p_value.get_type() == Variant::INT) {
701 format = (TileMapDataFormat)(p_value.operator int64_t()); // Set format used for loading.
702 return true;
703 }
704 }
705#ifndef DISABLE_DEPRECATED
706 else if (sname == "cell_quadrant_size") {
707 set_rendering_quadrant_size(p_value);
708 return true;
709 }
710#endif // DISABLE_DEPRECATED
711 else if (property_helper.is_property_valid(sname, &index)) {
712 if (index >= (int)layers.size()) {
713 while (index >= (int)layers.size()) {
714 TileMapLayer *new_layer = memnew(TileMapLayer);
715 add_child(new_layer, false, INTERNAL_MODE_FRONT);
716 new_layer->set_as_tile_map_internal_node(index);
717 new_layer->set_name(vformat("Layer%d", index));
718 new_layer->set_tile_set(tile_set);
719 new_layer->connect(CoreStringName(changed), callable_mp(this, &TileMap::_emit_changed));
720 layers.push_back(new_layer);
721 }
722
723 notify_property_list_changed();
724 _emit_changed();
725 update_configuration_warnings();
726 }
727
728 if (property_helper.property_set_value(sname, p_value)) {
729 if (components[1] == "tile_data") {
730 _emit_changed();
731 }
732 return true;
733 }
734 }
735 return false;
736}
737
738bool TileMap::_get(const StringName &p_name, Variant &r_ret) const {
739 const String sname = p_name;

Callers

nothing calls this directly

Calls 13

vformatFunction · 0.85
splitMethod · 0.80
int64_tMethod · 0.80
is_property_validMethod · 0.80
property_set_valueMethod · 0.80
sizeMethod · 0.65
connectMethod · 0.65
StringClass · 0.50
get_typeMethod · 0.45
set_nameMethod · 0.45
set_tile_setMethod · 0.45

Tested by

no test coverage detected