本文整理汇总了C++中JsonArray::get_float方法的典型用法代码示例。如果您正苦于以下问题:C++ JsonArray::get_float方法的具体用法?C++ JsonArray::get_float怎么用?C++ JsonArray::get_float使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonArray
的用法示例。
在下文中一共展示了JsonArray::get_float方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_internal
void melee_actor::load_internal( JsonObject &obj, const std::string & )
{
// Optional:
if( obj.has_array( "damage_max_instance" ) ) {
JsonArray arr = obj.get_array( "damage_max_instance" );
damage_max_instance = load_damage_instance( arr );
} else if( obj.has_object( "damage_max_instance" ) ) {
damage_max_instance = load_damage_instance( obj );
}
min_mul = obj.get_float( "min_mul", 0.0f );
max_mul = obj.get_float( "max_mul", 1.0f );
move_cost = obj.get_int( "move_cost", 100 );
accuracy = obj.get_int( "accuracy", INT_MIN );
optional( obj, was_loaded, "miss_msg_u", miss_msg_u, translated_string_reader,
_( "The %s lunges at you, but you dodge!" ) );
optional( obj, was_loaded, "no_dmg_msg_u", no_dmg_msg_u, translated_string_reader,
_( "The %1$s bites your %2$s, but fails to penetrate armor!" ) );
optional( obj, was_loaded, "hit_dmg_u", hit_dmg_u, translated_string_reader,
_( "The %1$s bites your %2$s!" ) );
optional( obj, was_loaded, "miss_msg_npc", miss_msg_npc, translated_string_reader,
_( "The %s lunges at <npcname>, but they dodge!" ) );
optional( obj, was_loaded, "no_dmg_msg_npc", no_dmg_msg_npc, translated_string_reader,
_( "The %1$s bites <npcname>'s %2$s, but fails to penetrate armor!" ) );
optional( obj, was_loaded, "hit_dmg_npc", hit_dmg_npc, translated_string_reader,
_( "The %1$s bites <npcname>'s %2$s!" ) );
if( obj.has_array( "body_parts" ) ) {
JsonArray jarr = obj.get_array( "body_parts" );
while( jarr.has_more() ) {
JsonArray sub = jarr.next_array();
const body_part bp = get_body_part_token( sub.get_string( 0 ) );
const float prob = sub.get_float( 1 );
body_parts.add_or_replace( bp, prob );
}
}
if( obj.has_array( "effects" ) ) {
JsonArray jarr = obj.get_array( "effects" );
while( jarr.has_more() ) {
JsonObject eff = jarr.next_object();
effects.push_back( load_mon_effect_data( eff ) );
}
}
}