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

Method write_get

modules/gdscript/gdscript_byte_codegen.cpp:826–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824}
825
826void GDScriptByteCodeGenerator::write_get(const Address &p_target, const Address &p_index, const Address &p_source) {
827 if (HAS_BUILTIN_TYPE(p_source)) {
828 if (IS_BUILTIN_TYPE(p_index, Variant::INT) && Variant::get_member_validated_indexed_getter(p_source.type.builtin_type)) {
829 // Use indexed getter instead.
830 Variant::ValidatedIndexedGetter getter = Variant::get_member_validated_indexed_getter(p_source.type.builtin_type);
831 append_opcode(GDScriptFunction::OPCODE_GET_INDEXED_VALIDATED);
832 append(p_source);
833 append(p_index);
834 append(p_target);
835 append(getter);
836 return;
837 } else if (Variant::get_member_validated_keyed_getter(p_source.type.builtin_type)) {
838 Variant::ValidatedKeyedGetter getter = Variant::get_member_validated_keyed_getter(p_source.type.builtin_type);
839 append_opcode(GDScriptFunction::OPCODE_GET_KEYED_VALIDATED);
840 append(p_source);
841 append(p_index);
842 append(p_target);
843 append(getter);
844 return;
845 }
846 }
847 append_opcode(GDScriptFunction::OPCODE_GET_KEYED);
848 append(p_source);
849 append(p_index);
850 append(p_target);
851}
852
853void GDScriptByteCodeGenerator::write_set_named(const Address &p_target, const StringName &p_name, const Address &p_source) {
854 if (HAS_BUILTIN_TYPE(p_target) && Variant::get_member_validated_setter(p_target.type.builtin_type, p_name) &&

Callers 2

_parse_expressionMethod · 0.80
_parse_match_patternMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected