Пример #1
0
 void load( const VariantList& stream )
 {
   for( unsigned int i=0; i < stream.size(); i+=2 )
   {
     Service::Type type = Service::Type( stream.get( i ).toInt() );
     at( type )->set( stream.get( i+1 ).toFloat() ); //serviceValue
   }
 }
Пример #2
0
void GoodStock::load( const VariantList& stream )
{
  if( stream.size() < 3 )
    return;

  VariantList::const_iterator it=stream.begin();
  _type = (Good::Type)(*it).toInt(); it++;
  _maxQty = (*it).toInt(); it++;
  _currentQty = math::clamp( (*it).toInt(), 0, _maxQty );
}
Пример #3
0
    void load( const VariantList& stream )
    {
      if( stream.size() != 9 )
      {
        StringHelper::debug( 0xff, "%s [%s %d]", "Incorrect argument number in ", __FILE__, __LINE__ );
        return;
      }

      VariantList::const_iterator it=stream.begin();
      sellPrice = it->toUInt(); it++;
      buyPrice = it->toUInt(); it++;
      exportLimit = it->toUInt(); it++;
      importLimit = it->toUInt(); it++;
      soldGoods = it->toUInt(); it++;
      bougthGoods = it->toUInt(); it++;
      stacking = it->toBool(); it++;
      order = (CityTradeOptions::Order)it->toInt(); it++;
      vendor = it->toBool();
    }
Пример #4
0
    void load( const VariantList& stream )
    {
      if( stream.size() != 9 )
      {
        Logger::warning( "%s [%s %d]", "Incorrect argument number in ", __FILE__, __LINE__ );
        return;
      }

      VariantList::const_iterator it=stream.begin();
      sellPrice = it->toUInt(); ++it;
      buyPrice = it->toUInt(); ++it;
      exportLimit = it->toUInt(); ++it;
      importLimit = it->toUInt(); ++it;
      soldGoods = it->toUInt(); ++it;
      bougthGoods = it->toUInt(); ++it;
      stacking = it->toBool(); ++it;
      order = (trade::Order)it->toInt(); ++it;
      vendor = it->toBool();
    }