예제 #1
0
void mtype::add_special_attacks( JsonObject &jo, const std::string &member ) {

    if( !jo.has_array( member ) ) {
        return;
    }

    JsonArray outer = jo.get_array(member);
    while( outer.has_more() ) {
        if( outer.test_array() ) {
            add_special_attack( outer.next_array() );
        } else if( outer.test_object() ) {
            add_special_attack( outer.next_object() );
        } else {
            outer.throw_error( "array element is neither array nor object." );
        }
    }
}