예제 #1
0
        game_value remote_exec(const game_value &params_, sqf_string_const_ref function_, std::variant<int, object, sqf_string_const_ref_wrapper, side, group, std::reference_wrapper<const std::vector<game_value>>> targets_, std::optional<std::variant<sqf_string_const_ref_wrapper, bool, object, group>> jip_) {
            game_value targets;
            game_value jip;
            switch (targets_.index()) {
            case 0: targets = static_cast<float>(std::get<int>(targets_)); break;
            case 1: targets = std::get<object>(targets_); break;
            case 2: targets = std::get<2>(targets_).get(); break;
            case 3: targets = std::get<side>(targets_); break;
            case 4: targets = std::get<group>(targets_); break;
            case 5: targets = std::move(auto_array<game_value>({ std::get<5>(targets_).get().begin(), std::get<5>(targets_).get().end() })); break;
            }

            if (jip_.has_value()) {
                switch ((*jip_).index()) {
                case 0: jip = std::get<0>(*jip_).get(); break;
                case 1: jip = std::get<bool>(*jip_); break;
                case 2: jip = std::get<object>(*jip_); break;
                case 3: jip = std::get<group>(*jip_); break;
                }
            }
            game_value params_right = game_value({
                function_,
                targets,
                jip
            });

            return host::functions.invoke_raw_binary(__sqf::binary__remoteexec__any__array__ret__any, params_, params_right);
        }
예제 #2
0
 bool terrain_intersect_asl(const vector3 &begin_pos_, const vector3 &end_pos_) {
     game_value array_input({
         begin_pos_,
         end_pos_
     });
     return game_value(host::functions.invoke_raw_unary(client::__sqf::unary__terrainintersectasl__array__ret__bool, array_input));
 }
예제 #3
0
 bool line_intersects(const vector3 &begin_position_, const vector3 &end_position_, const object & ignore_obj_one_) {
     game_value array_input({
         begin_position_,
         end_position_,
         ignore_obj_one_
     });
     return game_value(host::functions.invoke_raw_unary(client::__sqf::unary__lineintersects__array__ret__bool, array_input));
 }
예제 #4
0
        std::vector<object> line_intersects_with(const vector3 &begin_pos_, const vector3 &end_pos_, bool sort_by_distance_) {
            game_value array_input({
                begin_pos_,
                end_pos_,
                game_value(),
                game_value(),
                sort_by_distance_
            });
            game_value intersects_value = host::functions.invoke_raw_unary(client::__sqf::unary__lineintersectswith__array__ret__array, array_input);

            game_data_array* intersects = ((game_data_array *)intersects_value.rv_data.data);

            std::vector<object> output;
            for (uint32_t i = 0; i < intersects->length; ++i) {
                output.push_back(object(intersects->data[i].rv_data));
            }

            return output;
        }
예제 #5
0
        sqf_return_string create_diary_record(const object &object_, sqf_string_const_ref subject_, sqf_string_const_ref title_, sqf_string_const_ref text_) {
            game_value params({
                subject_,
                game_value({
                title_,
                text_
            })
            });

            return host::functions.invoke_raw_binary(__sqf::binary__creatediaryrecord__object__array__ret__diary_record, object_, params);
        }
예제 #6
0
        intersect_surfaces_list line_intersects_surfaces(const vector3 &begin_pos_asl_, const vector3 &end_pos_asl_, const object & ignore_obj1_, const object & ignore_obj2_, bool sort_mode_, int max_results_, const std::string &lod1_, const std::string &lod2_) {
            game_value array_input = game_value({
                begin_pos_asl_,
                end_pos_asl_,
                ignore_obj1_,
                ignore_obj2_,
                sort_mode_,
                (float)max_results_,
                lod1_,
                lod2_
            });

            game_value intersects_value = host::functions.invoke_raw_unary(client::__sqf::unary__lineintersectssurfaces__array__ret__array, array_input);
            return __helpers::__line_intersects_surfaces(intersects_value);
        }
예제 #7
0
 float __number_unary_control(unary_function fnc_, const control &ctl_)
 {
     return game_value(host::functions.invoke_raw_unary(fnc_, ctl_));
 }
예제 #8
0
 float get_client_state_number() {
     return game_value(__helpers::__retrieve_nular_number(__sqf::nular__getclientstatenumber__ret__string));
 }
예제 #9
0
 bool __bool_unary_string(unary_function fnc_, const std::string &str_)
 {
     return game_value(host::functions.invoke_raw_unary(fnc_, str_));
 }
예제 #10
0
 bool __bool_unary_object(unary_function fnc_, const object &obj_)
 {
     return game_value(host::functions.invoke_raw_unary(fnc_, obj_));
 }
예제 #11
0
 bool __retrieve_nular_bool(nular_function fnc_) {
     return game_value(host::functions.invoke_raw_nular(fnc_));
 }
예제 #12
0
 vector3 __retrieve_nular_vector3(nular_function fnc_) {
     return game_value(host::functions.invoke_raw_nular(fnc_));
 }
예제 #13
0
 float __retrieve_nular_number(nular_function fnc_) {
     return game_value(host::functions.invoke_raw_nular(fnc_));
 }
예제 #14
0
 std::string __string_unary_control(unary_function fnc_, const control &ctl_)
 {
     return game_value(host::functions.invoke_raw_unary(fnc_, ctl_));
 }
예제 #15
0
 float __number_unary_number(unary_function fnc_, float val_)
 {
     return game_value(host::functions.invoke_raw_unary(fnc_, val_));
 }
예제 #16
0
 std::string __retrieve_nular_string(nular_function fnc_) {
     return game_value(host::functions.invoke_raw_nular(fnc_));
 }
예제 #17
0
 operator game_value() {
     return game_value(std::vector<game_value>({
         name,
         priority
     }));
 }
예제 #18
0
 bool intersect(const vector3 &begin_pos_, const vector3 &end_pos_, const object& obj_, const std::string &lodname_) {
     return game_value(host::functions.invoke_raw_binary(
         client::__sqf::binary__intersect__array__array__ret__array,
         begin_pos_,
         end_pos_));
 }