示例#1
0
// ----------------------------------
char *XML::Node::findAttr(const char *name)
{
	size_t nlen = strlen(name);
	for(int i=1; i<numAttr; i++)
    {
    	char *an = getAttrName(i);
    	if (strnicmp(an,name,nlen)==0)
        	return getAttrValue(i);
    }
    return NULL;
}
bool ManageRunesExpRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	RunesExpInfo * info = new RunesExpInfo();
	result = getAttrValue(element,"a", info->a) && result;
	result = getAttrValue(element,"b", info->b) && result;
	result = getAttrValue(element,"exp", info->exp) && result;
	result = getAttrValue(element,"level", info->level) && result;
	RunesExpInfoMap_t::iterator it = m_runes_exp_res_map.find(info->level);
	if (it != m_runes_exp_res_map.end())
	{
		DEF_LOG_ERROR("failed to load RUNESLEVEL, get reduplicate id <%d>\n",info->level);
		return false;
	}
	m_runes_exp_res_map.insert(std::make_pair(info->level, info));
	return result;
}
示例#3
0
bool ManageRaiseRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}

	bool result = true;

	RaiseResInfo * info = new RaiseResInfo();

	result = getAttrValue(element, "groupid", info->group_id) && result;
	result = getAttrValue(element, "serial", info->sequence_id) && result;
	result = getAttrValue(element, "str", info->str) && result;
	result = getAttrValue(element, "agi", info->agi) && result;
	result = getAttrValue(element, "int", info->int_value) && result;

	m_raise_info_vec.push_back(info);

	return result;
}
bool ManageSoulSetRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	SoulSetInfo * info = new SoulSetInfo();
	result = getAttrValue(element,"default_open", info->default_open) && result;
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"unlock", info->unlock) && result;
	result = getAttrValue(element,"unlock_cost", info->unlock_cost) && result;
	SoulSetInfoMap_t::iterator it = m_soul_set_res_map.find(info->id);
	if (it != m_soul_set_res_map.end())
	{
		DEF_LOG_ERROR("failed to load SOULSET, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_soul_set_res_map.insert(std::make_pair(info->id, info));
	return result;
}
bool ManageQqbragRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	QqbragInfo * info = new QqbragInfo();
	result = getAttrValue(element,"bonus", info->bonus) && result;
	result = getAttrValue(element,"id", info->id) && result;
//	result = getAttrValue(element,"img", info->img) && result;
	result = getAttrValue(element,"type", info->type) && result;
	QqbragInfoMap_t::iterator it = m_QQBrag__res_map.find(info->id);
	if (it != m_QQBrag__res_map.end())
	{
		DEF_LOG_ERROR("failed to load QQBRAG, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_QQBrag__res_map.insert(std::make_pair(info->id, info));
	return result;
}
bool ManageTavernspebilityRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	TavernspebilityInfo*  info  = new TavernspebilityInfo();
	result = getAttrValue(element,"hire_id", info->hire_id) && result;
	result = getAttrValue(element,"times1", info->times1) && result;
	result = getAttrValue(element,"times2", info->times2) && result;
	result = getAttrValue(element,"times3", info->times3) && result;
	TavernspebilityInfoMap_t::iterator it = m_tavernspebility__res_map.find(info->hire_id);
	if (it != m_tavernspebility__res_map.end())
	{
		DEF_LOG_ERROR("failed to load TAVERNSPEBILITY, get reduplicate id <%d>\n",info->hire_id);
		return false;
	}
	m_tavernspebility__res_map.insert(std::make_pair(info->hire_id, info));
	return result;
}
bool ManageDailyPointsRes::loadDailyPointsEeventInfo(Element * element)
{
	if (NULL == element) return false;

	bool result = true;
	DailyPointsEvents * info = new DailyPointsEvents();

	result = getAttrValue(element, "id", info->id) && result;
	result = getAttrValue(element, "eventid", info->event_id) && result;
	result = getAttrValue(element, "num", info->num) && result;
	result = getAttrValue(element, "unlock_min", info->min_lev) && result;
	result = getAttrValue(element, "unlock_max", info->max_lev) && result;
	result = getAttrValue(element, "point", info->point) && result;


	DailyPointsEventsMap_t::iterator it = m_dailypoints_events_map.find(info->id);
	if (it != m_dailypoints_events_map.end())
	{
		DEF_LOG_ERROR("failed to load dailypoints_event.xml, get reduplicate dailypoints_event.xml id <%d>\n", info->id);
		return false;
	}

	m_dailypoints_events_map.insert(std::make_pair(info->id, info));
	return result;
}
示例#8
0
void SAXBiomlHandler::startElement(const XML_Char *el, const XML_Char **attr)
{
	if(isElement("protein", el)){
		m_bProtein = true;
		string strValue;
		strValue = getAttrValue("label", attr);
		m_seqCurrent.m_strSeq.erase(0,m_seqCurrent.m_strSeq.size());
		m_seqCurrent.m_strDes = strValue;
		m_seqCurrent.m_bForward = true;
		if(strValue.find(":reversed") != strValue.npos)	{
			m_seqCurrent.m_bForward = false;
		}
		strValue = getAttrValue("uid",attr);
		m_seqCurrent.m_tUid = (size_t)atoi(strValue.c_str());
	}
	else if(isElement("file", el) && m_bProtein){
		string strValue;
		strValue = getAttrValue("URL", attr);
		short int iPath = 0;
		if(m_setPaths.find(strValue) == m_setPaths.end())	{
			m_setPaths.insert(strValue);
			iPath = (short int) m_vstrPaths.size();
			m_vstrPaths.push_back(strValue);
		}
		else	{
			size_t a = 0;
			while(a < m_vstrPaths.size())	{
				if(m_vstrPaths[a] == strValue)	{
					iPath = (short int) a;
					break;
				}
				a++;
			}
		}
		m_seqCurrent.m_siPath = iPath;
	}
	else if(isElement("peptide", el)){
		m_bPeptide = true;
	}
}
bool ManageRankingRuleRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	RankingRuleInfo * info = new RankingRuleInfo();
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"list", info->list) && result;
	result = getAttrValue(element,"mail_id", info->mail_id) && result;
	result = getAttrValue(element,"num", info->num) && result;
	result = getAttrValue(element,"update_time", info->update_time) && result;
	RankingRuleInfoMap_t::iterator it = m_Ranking_Rule_res_map.find(info->id);
	if (it != m_Ranking_Rule_res_map.end())
	{
		DEF_LOG_ERROR("failed to load RANKINGRULE, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_Ranking_Rule_res_map.insert(std::make_pair(info->id, info));
	return result;
}
示例#10
0
bool ManageAmahRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	AmahInfo * info = new AmahInfo();
	result = getAttrValue(element,"goldblessme_id", info->goldblessme_id) && result;
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"level", info->level) && result;
	result = getAttrValue(element,"rewardrate", info->rewardrate) && result;
	result = getAttrValue(element,"sysname", info->sysname) && result;
	AmahInfoMap_t::iterator it = m_amah__res_map.find(info->id);
	if (it != m_amah__res_map.end())
	{
		DEF_LOG_ERROR("failed to load AMAH, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_amah__res_map.insert(std::make_pair(info->id, info));
	return result;
}
bool ManageRingGuildRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	RingGuildInfo * info = new RingGuildInfo();
	result = getAttrValue(element,"bonus_id1", info->bonus_id1) && result;
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"level1", info->level1) && result;
	result = getAttrValue(element,"ring_quest_max", info->ring_quest_max) && result;
	result = getAttrValue(element, "ring_loop", info->ring_loop) && result;
	RingGuildInfoMap_t::iterator it = m_ring_guild_res_map.find(info->id);
	if (it != m_ring_guild_res_map.end())
	{
		DEF_LOG_ERROR("failed to load RINGGUILD, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_ring_guild_res_map.insert(std::make_pair(info->id, info));
	return result;
}
示例#12
0
void FVAnimation::updateAttributes( )
{
    QStringList argv;
    argv.append( QString("setTime") );
    argv.append( getAttrValue( tr("Current Time:") ) );

    manager->sendMessage( argv, this, true );


    update();

    int speed = 0;
    if (tmr != 0) {
        delete tmr;
        tmr = 0;
    }
    QString s = getAttrValue( tr("Play Speed:") );
    if (s == tr("Turtle")) speed = 3000;
    if (s == tr("Slow")) speed = 1000;
    if (s == tr("Normal")) speed = 500;
    if (s == tr("Fast")) speed = 250;
    if (s == tr("Cheetah")) speed = 100;

    if (speed > 0) {
        tmr = new QTimer();
        connect( tmr,SIGNAL(timeout()), this, SLOT( slotTimer() ) );
        tmr->start( speed );
    }

    if (speed > 0) {
        acPlay->setEnabled( false );
        acPause->setEnabled( true );
        acStop->setEnabled( true );
    } else {
        acPlay->setEnabled( true );
        acPause->setEnabled( false );
        acStop->setEnabled( false );
    }
}
bool ManageDanyaoHechengRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	DanyaoHechengInfo * info = new DanyaoHechengInfo();
	result = getAttrValue(element,"gold", info->gold) && result;
	result = getAttrValue(element,"goldblessme_id", info->goldblessme_id) && result;
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"needitem", info->needitem) && result;
	result = getAttrValue(element,"neednum", info->neednum) && result;
	DanyaoHechengInfoMap_t::iterator it = m_danyao_hecheng_res_map.find(info->needitem);
	if (it != m_danyao_hecheng_res_map.end())
	{
		DEF_LOG_ERROR("failed to load DANYAOHECHENG, get reduplicate id <%d>\n",info->needitem);
		return false;
	}
	m_danyao_hecheng_res_map.insert(std::make_pair(info->needitem, info));
	return result;
}
示例#14
0
void SAXGamlHandler::startElement(const XML_Char *el, const XML_Char **attr)
{
	if(isElement("note", el) && !(strcmp("Description", getAttrValue("label", attr)))){
		m_bDesc = true;
		m_strDesc="";
	}
	else if(isElement("group", el) && !(strcmp("model", getAttrValue("type", attr)))){
		string strValue;
		strValue = getAttrValue("sumI", attr);
		if(!strValue.empty()){
			m_dSum = pow(10.0,atof(strValue.c_str()));
		}
		strValue = getAttrValue("maxI", attr);
		if(!strValue.empty()){
			m_dMax = atof(strValue.c_str());
		}
		strValue = getAttrValue("fI", attr);
		if(!strValue.empty()){
			m_dFactor = atof(strValue.c_str());
		}
		m_tId = atoi(getAttrValue("id", attr));
		m_scanNum = (int)m_tId;
		m_precursorCharge = atoi(getAttrValue("z", attr));
		m_precursorMz = atof(getAttrValue("mh", attr));
	}
	else if(isElement("GAML:trace", el) && !(strcmp("tandem mass spectrum", getAttrValue("type", attr)))){
		m_bInData = true;
	}
	else if(isElement("GAML:Xdata", el) && m_bInData){
		m_bMZ = true;
	}
	else if(isElement("GAML:Ydata", el) && m_bInData){
		m_bINT = true;
	}
	else if(isElement("GAML:values", el) && m_bInData){
		m_peaksCount = atoi(getAttrValue("numvalues", attr));
	}
}
bool ManageDailyPointsRes::loadDailyPointsRewardInfo(Element * element)
{
	if (NULL == element) return false;

	bool result = true;
	DailyPointsReward * info = new DailyPointsReward();

	result = getAttrValue(element, "id", info->id) && result;
	result = getAttrValue(element, "lv", info->lev) && result;
	result = getAttrValue(element, "point", info->vec_point) && result;
	result = getAttrValue(element, "bonus_id", info->vec_bonus_id) && result;
	result = getAttrValue(element, "confrater_exp", info->vec_guild_exp) && result;

	DailyPointsRewardMap_t::iterator it = m_dailypoints_reward_map.find(info->id);
	if (it != m_dailypoints_reward_map.end())
	{
		DEF_LOG_ERROR("failed to load dailypoints_reward.xml, get reduplicate dailypoints_reward.xml id <%d>\n", info->id);
		return false;
	}

	m_dailypoints_reward_map.insert(std::make_pair(info->id, info));
	return result;
}
bool ManageBillListRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	BillListInfo * info = new BillListInfo();
	result = getAttrValue(element,"bonus", info->bonus) && result;
	result = getAttrValue(element,"end_time", info->end_time) && result;
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"max", info->max) && result;
	result = getAttrValue(element,"start_time", info->start_time) && result;
	result = getAttrValue(element,"target_id", info->target_id) && result;
	result = getAttrValue(element,"target_max", info->target_max) && result;
	result = getAttrValue(element,"target_min", info->target_min) && result;

    Uint32Vec_t::size_type min_size = info->target_id.size();
    Uint32Vec_t::size_type max_size = info->target_id.size();

    min_size = std::min(min_size, info->target_min.size());
    max_size = std::max(max_size, info->target_min.size());

    min_size = std::min(min_size, info->target_max.size());
    max_size = std::max(max_size, info->target_max.size());

    min_size = std::min(min_size, info->bonus.size());
    max_size = std::max(max_size, info->bonus.size());

    min_size = std::min(min_size, info->max.size());
    max_size = std::max(max_size, info->max.size());
    if( min_size != max_size)
    {
        DEF_LOG_ERROR("failed to load BILLLIST, <%d> array size is not equal\n",info->id);
        return false;
    }

	BillListInfoMap_t::iterator it = m_Bill_List_res_map.find(info->id);
	if (it != m_Bill_List_res_map.end())
	{
		DEF_LOG_ERROR("failed to load BILLLIST, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_Bill_List_res_map.insert(std::make_pair(info->id, info));
	return result;
}
示例#17
0
string HTMLParser	::	getString( bool aConserveSpaces )	{

	string result;

	switch ( mContent[mPos] )	{
		case '>' :	{
			cout << mLineNr << " " << mCharNr << ": Getting text...\n";
			result = getText( aConserveSpaces );
			mStringType = TEXT;
			break;
		}
		case '<' :	{
			cout << mLineNr << " " << mCharNr << ": Getting tag...\n";
			result = getTag();
			mStringType = TAG;
			break;
		}
		case '=' :	{
			cout << mLineNr << " " << mCharNr << ": Getting attribute value: ";
			result = getAttrValue();
			cout << result << endl;
			mStringType = ATTRVALUE;
			break;
		}
		default :	{
			cout << mLineNr << " " << mCharNr << ": Getting attribute: ";
			result = getAttribute();
			cout << result << endl;
			mStringType = ATTR;
		}
	}

	if ( mPos == mContent.size() && result == "" )	{
		throw ReadException();
	}

	return result;
	
}
bool ManageArrestControllerRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	ArrestControllerInfo * info = new ArrestControllerInfo();
	result = getAttrValue(element,"goldblessme_id", info->goldblessme_id) && result;
	result = getAttrValue(element,"limit", info->limit) && result;
	result = getAttrValue(element,"sundry", info->sundry) && result;
	result = getAttrValue(element,"type", info->type) && result;
	result = getAttrValue(element,"vip_id1", info->vip_id1) && result;
	result = getAttrValue(element,"vip_id2", info->vip_id2) && result;
	m_Arrest_Controller_res_vec.push_back(info);
	return result;
}
示例#19
0
void SAXMzxmlHandler::startElement(const XML_Char *el, const XML_Char **attr)
{
	if(isElement("scan", el))
	{
		if((m_cidLevel = atoi(getAttrValue("msLevel", attr))) == 2)
		{
			m_bInMsLevel2 = true;

			reset();	// Clean up for the next scan

			m_scanNum = atoi(getAttrValue("num", attr));
			m_tId = m_scanNum;
			while(m_sId.find(m_tId) != m_sId.end())	{
				m_tId++;
			}
			m_sId.insert(m_tId);
			m_peaksCount = atoi(getAttrValue("peaksCount", attr));
			m_strRt = getAttrValue("retentionTime", attr);
		}
	}
	else if(isElement("peaks", el))
	{
		m_bInPeaks = true;
		m_bLowPrecision = (strcmp("64", getAttrValue("precision", attr)) != 0);
		const char *pcompressionType = getAttrValue("compressionType", attr);
		if(*pcompressionType != '\0')	{
			cout << "Non-standard CODEC used for mzXML peak data (CODEC type=" << pcompressionType << "): file cannot be interpretted.\n";
			exit(EXIT_FAILURE);
		}
	}
	else if(isElement("precursorMz", el))
	{
		if (m_cidLevel < 3) {
			//don't read precursor data if ms level >= 3
			m_bInPrecursorMz = true;
			m_precursorCharge = atoi(getAttrValue("precursorCharge", attr));
		}
	}
}
示例#20
0
bool ManageTargetRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	TargetInfo * info = new TargetInfo();
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"reward_num", info->reward_num) && result;
	result = getAttrValue(element,"spe_reward", info->spe_reward) && result;
	result = getAttrValue(element,"target", info->target) && result;
	result = getAttrValue(element,"type", info->type) && result;
	result = getAttrValue(element,"value", info->value) && result;
	TargetInfoMap_t::iterator it = m_Target__res_map.find(info->id);
	if (it != m_Target__res_map.end())
	{
		DEF_LOG_ERROR("failed to load TARGET, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_Target__res_map.insert(std::make_pair(info->id, info));
	return result;
}
示例#21
0
bool ManagePvpRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	result = getAttrValue(element,"battlemap1", m_pvp_res_.battlemap1) && result;
	result = getAttrValue(element,"battlemap2", m_pvp_res_.battlemap2) && result;
	result = getAttrValue(element,"battletimes", m_pvp_res_.battletimes) && result;
	result = getAttrValue(element,"defeatedtimes1", m_pvp_res_.defeatedtimes1) && result;
	result = getAttrValue(element,"defeatedtimes2", m_pvp_res_.defeatedtimes2) && result;
	result = getAttrValue(element,"joinlevel", m_pvp_res_.joinlevel) && result;
	result = getAttrValue(element,"jointime1", m_pvp_res_.jointime1) && result;
	result = getAttrValue(element,"jointime2", m_pvp_res_.jointime2) && result;
	result = getAttrValue(element,"part1begintime", m_pvp_res_.part1begintime) && result;
	result = getAttrValue(element,"part1num", m_pvp_res_.part1num) && result;
	//result = getAttrValue(element,"part1resttime", m_pvp_res_.part1resttime) && result;
	result = getAttrValue(element,"part1rundtime", m_pvp_res_.part1rundtime) && result;
	result = getAttrValue(element,"part2begintime1", m_pvp_res_.part2begintime1) && result;
	result = getAttrValue(element,"part2begintime2", m_pvp_res_.part2begintime2) && result;
	result = getAttrValue(element,"part2begintime3", m_pvp_res_.part2begintime3) && result;
	result = getAttrValue(element,"part2begintime4", m_pvp_res_.part2begintime4) && result;
	result = getAttrValue(element,"part2begintime5", m_pvp_res_.part2begintime5) && result;
	result = getAttrValue(element,"part2rundtime", m_pvp_res_.part2rundtime) && result;
	result = getAttrValue(element,"start_time", m_pvp_res_.start_time) && result;
	return result;
}
bool ManageDailyBonusRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}

	bool result = true;

	DailyBonusResInfo * info = new DailyBonusResInfo();

	result = getAttrValue(element, "id", info->id) && result;
	result = getAttrValue(element, "bonustype", info->bonustype) && result;
	result = getAttrValue(element, "a", info->a) && result;
	result = getAttrValue(element, "b", info->b) && result;
	result = getAttrValue(element, "lv", info->lv) && result;
	result = getAttrValue(element, "limit", info->limit_time) && result;
	result = getAttrValue(element, "opentime", info->enable_level) && result;

    result = getAttrValue(element, "bonus_id", info->bonus_id) && result;
    result = getAttrValue(element, "boom", info->boom) && result;

    result = getAttrValue(element, "free_a", info->free_a) && result;
    result = getAttrValue(element, "free_b", info->free_b) && result;
    result = getAttrValue(element, "critical_num", info->critial_num_vec) && result;
    result = getAttrValue(element, "critical_value", info->critial_value_vec) && result;
    result = getAttrValue(element, "boom_num", info->boom_num) && result;
    result = getAttrValue(element, "talk", info->talk) && result;


	DailyBonusResInfoMap_t::iterator it = m_daily_bonus_info_map.find(info->id);
	if (it != m_daily_bonus_info_map.end())
	{
		DEF_LOG_ERROR("get reduplicate DailyBonus id : <%d>\n", info->id);
		return false;
	}

	m_daily_bonus_info_map.insert(std::make_pair(info->id, info));

	return result;
}
bool ManageRunesSystemRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	result = getAttrValue(element,"change_rate", m_runes_system_res.change_rate) && result;
	result = getAttrValue(element,"critical_rate1", m_runes_system_res.critical_rate1) && result;
	result = getAttrValue(element,"critical_rate2", m_runes_system_res.critical_rate2) && result;
	result = getAttrValue(element,"critical_value1", m_runes_system_res.critical_value1) && result;
	result = getAttrValue(element,"critical_value2", m_runes_system_res.critical_value2) && result;
	result = getAttrValue(element,"critical_value3", m_runes_system_res.critical_value3) && result;
	result = getAttrValue(element,"critical_value4", m_runes_system_res.critical_value4) && result;
	result = getAttrValue(element,"runes1", m_runes_system_res.runes1) && result;
	result = getAttrValue(element,"runes2", m_runes_system_res.runes2) && result;
	result = getAttrValue(element,"runes3", m_runes_system_res.runes3) && result;
	result = getAttrValue(element,"runes4", m_runes_system_res.runes4) && result;
	result = getAttrValue(element,"runes5", m_runes_system_res.runes5) && result;
	result = getAttrValue(element,"runes_stone_exp", m_runes_system_res.runes_stone_exp) && result;
	result = getAttrValue(element,"unlock_stone_num", m_runes_system_res.unlock_stone_num) && result;

	return result;
}
示例#24
0
bool ManageLawRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}

	bool result = true;

	LawResInfo * info = new LawResInfo();

	result = getAttrValue(element, "heart_id", info->heart_id) && result;
	result = getAttrValue(element, "law_id", info->law_id) && result;
	result = getAttrValue(element, "law_level", info->law_level) && result;
	result = getAttrValue(element, "need_level", info->need_level) && result;
	result = getAttrValue(element, "need_item", info->need_item) && result;
	result = getAttrValue(element, "martial", info->martial) && result;
	result = getAttrValue(element, "lawpay", info->lawpay) && result;
	result = getAttrValue(element, "function_id", info->function_id) && result;
	result = getAttrValue(element, "function_num", info->function_num) && result;
	result = getAttrValue(element, "display_level", info->display_level) && result;
	result = getAttrValue(element, "display_martial", info->display_martial) && result;
	result = getAttrValue(element, "group", info->group) && result;
	result = getAttrValue(element, "lawname", info->name) && result;
	result = getAttrValue(element, "type", info->type_value) && result;
	result = getAttrValue(element, "delay", info->delay) && result;
	result = getAttrValue(element, "first_strike", info->first_strike) && result;
	result = getAttrValue(element, "costmoney", info->money_cost) && result;

	m_law_info_vec.push_back(info);

	return result;
}
bool ManageGoldCardRes::loadInfo(Element * element)
{
	if (NULL == element)
	{
		return false;
	}
	bool result = true;
	GoldCardInfo * info = new GoldCardInfo();
	result = getAttrValue(element,"bonus_rewards", info->bonus_rewards) && result;
	result = getAttrValue(element,"day", info->day) && result;
	result = getAttrValue(element,"first_rewards", info->first_rewards) && result;
	result = getAttrValue(element,"gold_rewards", info->gold_rewards) && result;
	result = getAttrValue(element,"id", info->id) && result;
	result = getAttrValue(element,"level", info->level) && result;
	result = getAttrValue(element,"need_gold", info->need_gold) && result;
	result = getAttrValue(element,"p", info->p) && result;
	result = getAttrValue(element,"talk", info->talk) && result;
	result = getAttrValue(element,"target", info->target) && result;
	result = getAttrValue(element,"unlock_gold", info->unlock_gold) && result;
	result = getAttrValue(element,"v", info->v) && result;
	result = getAttrValue(element,"name", info->card_name) && result;
	result = getAttrValue(element,"first_bonus", info->first_bonus) && result;
	GoldCardInfoMap_t::iterator it = m_gold_card_res_map.find(info->id);
	if (it != m_gold_card_res_map.end())
	{
		DEF_LOG_ERROR("failed to load GOLDCARD, get reduplicate id <%d>\n",info->id);
		return false;
	}
	m_gold_card_res_map.insert(std::make_pair(info->id, info));
	return result;
}
示例#26
0
float KCharacterAttr::getCritNum()
{
	float value  = (float)(getAttrValue(KAttributeAbout::ca_critNum));
	return value/100;
}
示例#27
0
float KCharacterAttr::getTough()
{
	float value  = (float)(getAttrValue(KAttributeAbout::ca_tough));
	return value/100;
}
示例#28
0
float KCharacterAttr::getMiss()
{
	float value  = (float)(getAttrValue(KAttributeAbout::ca_miss));
	return value/100;
}
示例#29
0
float KCharacterAttr::getBaseHit()
{
	float value  = (float)(getAttrValue(KAttributeAbout::ca_baseHit));
	return value/100;
}
示例#30
0
float KCharacterAttr::getMoveSpeed()
{
	float speed  = (float)(getAttrValue(KAttributeAbout::ca_moveSpeed));
	return speed/100;
}