inline items_t create_items(){ items_t items; items.push_back( item_t() ); items.push_back( item_t() ); items.push_back( item_t() ); return items; }
int cWorld::BuildItems( vector<string>& item_v ) { for(unsigned i= 0; i < item_v.size(); i++) { item_build_instructions instructions; string item_str = item_v[i]; vector<string> id_item; boost::split(id_item, item_str, boost::is_any_of(":")); const int expected_field_count = 5; if( id_item.size() < expected_field_count || id_item.size() > expected_field_count ) { return 1; } //string item_id = id_item[0]; instructions.id = id_item[0]; instructions.dimension_units = id_item[1]; instructions.constraints = (int) atof( id_item[2].c_str() ); int quantity = (int) atof( id_item[3].c_str() ); string item_size = id_item[4]; id_item.clear(); vector<string> item_size_v; boost::split(item_size_v, item_size, boost::is_any_of("x")); if ( isDimError( (int)item_size_v.size() ) == true ) { return 2; } instructions.size_v = item_size_v; for( int k = 0; k < quantity; k++ ) { Items.push_back( item_t( Item::Build( instructions ) ) ); } } return 0; }
{ assert( name_str.size() ); return name_str; } std::string n; if ( driver() -> id() > 0 ) { n = driver() -> name_cstr(); // Append the spell ID of the driver to the cooldown name. In some cases, the // drivers of different trinket procs are actually named identically, causing // issues when the trinkets are worn. n += "_" + util::to_string( driver() -> id() ); } else if ( item ) { n = item -> name(); n += "_"; n += item -> slot_name(); } util::tokenize( n ); assert( ! n.empty() ); return n; } const item_t dbc_proc_callback_t::default_item_ = item_t();