您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uniform_random函数代码示例

51自学网 2021-06-03 09:09:54
  C++
这篇教程C++ uniform_random函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中uniform_random函数的典型用法代码示例。如果您正苦于以下问题:C++ uniform_random函数的具体用法?C++ uniform_random怎么用?C++ uniform_random使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了uniform_random函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: uniform_random

bool AreaSpawnEvent::executeEvent(){	for (MonsterSpawn* spawn : m_spawnList) {		uint32_t amount = uniform_random(spawn->minAmount, spawn->maxAmount);		for (uint32_t i = 0; i < amount; ++i) {			Monster* monster = Monster::createMonster(spawn->name);			if (!monster) {				std::cout << "[Error - AreaSpawnEvent::executeEvent] Can't create monster " << spawn->name << std::endl;				return false;			}			bool success = false;			for (int32_t tries = 0; tries < MAXIMUM_TRIES_PER_MONSTER; tries++) {				Position pos(uniform_random(m_fromPos.x, m_toPos.x), uniform_random(m_fromPos.y, m_toPos.y), uniform_random(m_fromPos.z, m_toPos.z));				Tile* tile = g_game.getTile(pos);				if (tile && !tile->isMoveableBlocking() && !tile->hasFlag(TILESTATE_PROTECTIONZONE) && tile->getTopCreature() == nullptr && g_game.placeCreature(monster, pos, false, true)) {					success = true;					break;				}			}			if (!success) {				delete monster;			}		}	}	return true;}
开发者ID:HeavenIsLost,项目名称:ChronusServer,代码行数:28,


示例2: do_wide_fills

static cairo_time_tdo_wide_fills (cairo_t *cr, int width, int height, int loops){    int count;    /* lots and lots of overlapping stroke-like fills */    state = 0xc0ffee;    for (count = 0; count < 1000; count++) {	cairo_save (cr);	cairo_translate (cr,			 uniform_random (0, width),			 uniform_random (0, height));	cairo_rotate (cr, uniform_random (-M_PI,M_PI));	cairo_rectangle (cr, 0, 0, uniform_random (0, width), 5);	cairo_restore (cr);    }    cairo_perf_timer_start ();    while (loops--)	cairo_fill_preserve (cr);    cairo_perf_timer_stop ();    cairo_new_path (cr);    return cairo_perf_timer_elapsed ();}
开发者ID:AZed,项目名称:cairo,代码行数:28,


示例3: if

BlockType_t Creature::blockHit(Creature* attacker, CombatType_t combatType, int32_t& damage,                               bool checkDefense /* = false */, bool checkArmor /* = false */, bool /* field  = false */){	BlockType_t blockType = BLOCK_NONE;	if (isImmune(combatType)) {		damage = 0;		blockType = BLOCK_IMMUNITY;	} else if (checkDefense || checkArmor) {		bool hasDefense = false;		if (blockCount > 0) {			--blockCount;			hasDefense = true;		}		if (checkDefense && hasDefense) {			int32_t defense = getDefense();			damage -= uniform_random(defense / 2, defense);			if (damage <= 0) {				damage = 0;				blockType = BLOCK_DEFENSE;				checkArmor = false;			}		}		if (checkArmor) {			int32_t armorValue = getArmor();			if (armorValue > 1) {				double armorFormula = armorValue * 0.475;				int32_t armorReduction = static_cast<int32_t>(std::ceil(armorFormula));				damage -= uniform_random(					armorReduction,					armorReduction + static_cast<int32_t>(std::floor(armorFormula))				);			} else if (armorValue == 1) {				--damage;			}			if (damage <= 0) {				damage = 0;				blockType = BLOCK_ARMOR;			}		}		if (hasDefense && blockType != BLOCK_NONE) {			onBlockHit();		}	}	if (attacker) {		attacker->onAttackedCreature(this);		attacker->onAttackedCreatureBlockHit(blockType);	}	onAttacked();	return blockType;}
开发者ID:A-Syntax,项目名称:forgottenserver,代码行数:58,


示例4: main

int main() {    std::vector<float> a(10);    uniform_random(a,0,10);    for (auto el : a) { std::cout << el << " "; }        std::cout << '/n';    std::vector<int> b(10);    uniform_random(b,0,10);    for (auto el : b) { std::cout << el << " "; }}
开发者ID:CCJY,项目名称:coliru,代码行数:10,


示例5: if

BlockType_t Creature::blockHit(Creature* attacker, CombatType_t combatType, int32_t& damage,                               bool checkDefense /* = false */, bool checkArmor /* = false */, bool /* field  = false */){	BlockType_t blockType = BLOCK_NONE;	if (isImmune(combatType)) {		damage = 0;		blockType = BLOCK_IMMUNITY;	} else if (checkDefense || checkArmor) {		bool hasDefense = false;		if (blockCount > 0) {			--blockCount;			hasDefense = true;		}		if (checkDefense && hasDefense && canUseDefense) {			int32_t defense = getDefense();			damage -= uniform_random(defense / 2, defense);			if (damage <= 0) {				damage = 0;				blockType = BLOCK_DEFENSE;				checkArmor = false;			}		}		if (checkArmor) {			int32_t armor = getArmor();			if (armor > 3) {				damage -= uniform_random(armor / 2, armor - (armor % 2 + 1));			} else if (armor > 0) {				--damage;			}			if (damage <= 0) {				damage = 0;				blockType = BLOCK_ARMOR;			}		}		if (hasDefense && blockType != BLOCK_NONE) {			onBlockHit();		}	}	if (attacker) {		attacker->onAttackedCreature(this);		attacker->onAttackedCreatureBlockHit(blockType);	}	onAttacked();	return blockType;}
开发者ID:Sornii,项目名称:forgottenserver,代码行数:53,


示例6: uniform_random

        /**         * Randomly sets the values of the quaternion to random values.         */        void quaternion_t::random( )        {            double s = uniform_random();            double roll1 = sqrt(1-s);            double roll2 = sqrt(s);            double theta1 = 2*PRX_PI*uniform_random();            double theta2 = 2*PRX_PI*uniform_random();            q[0] = sin(theta1) * roll1;            q[1] = cos(theta1) * roll1;            q[2] = sin(theta2) * roll2;            q[3] = cos(theta2) * roll2;        }
开发者ID:amazon-picking-challenge,项目名称:ru_pracsys,代码行数:16,


示例7: do_curve_stroke

static cairo_time_tdo_curve_stroke (cairo_t *cr, int width, int height, int loops){    state = 0xc0ffee;    cairo_set_line_width (cr, 2.);    cairo_perf_timer_start ();    cairo_perf_set_thread_aware (cr, FALSE);    while (loops--) {	if (loops == 0)		cairo_perf_set_thread_aware (cr, TRUE);	double x1 = uniform_random (0, width);	double x2 = uniform_random (0, width);	double x3 = uniform_random (0, width);	double y1 = uniform_random (0, height);	double y2 = uniform_random (0, height);	double y3 = uniform_random (0, height);	cairo_move_to (cr, uniform_random (0, width), uniform_random (0, height));	cairo_curve_to (cr, x1, y1, x2, y2, x3, y3);	cairo_stroke(cr);    }    cairo_perf_timer_stop ();    return cairo_perf_timer_elapsed ();}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:26,


示例8: uniform_random

        bool apc_sampler_t::sample_inside(state_t* result_point, const util::vector_t& min_bounds, const util::vector_t& max_bounds)        {            config_t grasp_config;            for( unsigned i = 0; i < max_tries; ++i )            {                grasp_config.set_position_at(0, uniform_random(min_bounds[0], max_bounds[0]));                grasp_config.set_position_at(1, uniform_random(min_bounds[1], max_bounds[1]));                grasp_config.set_position_at(2, uniform_random(min_bounds[2], max_bounds[2]));                double angle = uniform_random(-theta_error, theta_error);                double qx = sin(angle);                double qy = cos(angle);                double qz = 0;                angle = uniform_random(1.57 - theta_error, 1.57 + theta_error) / 2.0;                qx = qx * sin(angle);                qy = qy * sin(angle);                qz = qz * sin(angle);                double qw = cos(angle);                grasp_config.set_orientation(qx, qy, qz, qw);                if( IK_base != NULL )                {                    if(IK_base->has_data())                    {                        std::vector< sim::state_t* > states;                        IK_base->get_near_neighbors( states , grasp_config, 1);                        manip_space->copy_point( manip_point, states[0] );                    }                    else                    {                        // PRX_WARN_S("Linked IK database has no data.");                        manip_space->uniform_sample(manip_point);                    }                }                else                    manip_space->uniform_sample(manip_point);                if( _manipulator->IK_solver(grasp_config, result_point, gripper_mode, manip_point) )                {                    result_point->memory[15] = 0;                    return true;                }            }            return false;        }
开发者ID:amazon-picking-challenge,项目名称:ru_pracsys,代码行数:48,


示例9: setTicks

void ConditionSpeed::addCondition(Creature* creature, const Condition* addCondition){	if (conditionType != addCondition->getType()) {		return;	}	if (ticks == -1 && addCondition->getTicks() > 0) {		return;	}	setTicks(addCondition->getTicks());	const ConditionSpeed& conditionSpeed = static_cast<const ConditionSpeed&>(*addCondition);	int32_t oldSpeedDelta = speedDelta;	speedDelta = conditionSpeed.speedDelta;	mina = conditionSpeed.mina;	maxa = conditionSpeed.maxa;	minb = conditionSpeed.minb;	maxb = conditionSpeed.maxb;	if (speedDelta == 0) {		int32_t min;		int32_t max;		getFormulaValues(creature->getBaseSpeed(), min, max);		speedDelta = uniform_random(min, max);	}	int32_t newSpeedChange = (speedDelta - oldSpeedDelta);	if (newSpeedChange != 0) {		g_game.changeSpeed(creature, newSpeedChange);	}}
开发者ID:A-Dirty-Rag,项目名称:forgottenserver,代码行数:32,


示例10: getElementDamage

int32_t WeaponDistance::getElementDamage(const Player* player, const Creature* target, const Item* item) const{	if (elementType == COMBAT_NONE) {		return 0;	}	int32_t attackValue = elementDamage;	if (item->getWeaponType() == WEAPON_AMMO) {		Item* bow = const_cast<Player*>(player)->getWeapon(true);		if (bow) {			attackValue += bow->getAttack();		}	}	int32_t attackSkill = player->getSkill(SKILL_DIST, SKILL_LEVEL);	float attackFactor = player->getAttackFactor();	int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor);	if (uniform_random(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE)) {		maxValue *= 2;	}	int32_t minValue = 0;	if (target) {		if (target->getPlayer()) {			minValue = static_cast<int32_t>(std::ceil(player->getLevel() * 0.1));		} else {			minValue = static_cast<int32_t>(std::ceil(player->getLevel() * 0.2));		}	}	return -normal_random(minValue, static_cast<int32_t>(maxValue * player->getVocation()->distDamageMultiplier));}
开发者ID:d33tah,项目名称:forgottenserver,代码行数:33,


示例11: useFist

bool Weapon::useFist(Player* player, Creature* target){	const Position& playerPos = player->getPosition();	const Position& targetPos = target->getPosition();	if (Position::areInRange<1, 1>(playerPos, targetPos)) {		float attackFactor = player->getAttackFactor();		int32_t attackSkill = player->getSkill(SKILL_FIST, SKILL_LEVEL);		int32_t attackValue = 7;		int32_t maxDamage = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor);		if (uniform_random(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE)) {			maxDamage *= 2;		}		CombatParams params;		params.combatType = COMBAT_PHYSICALDAMAGE;		params.blockedByArmor = true;		params.blockedByShield = true;		CombatDamage damage;		damage.primary.type = params.combatType;		damage.primary.value = -normal_random(0, maxDamage);		Combat::doCombatHealth(player, target, damage, params);		if (!player->hasFlag(PlayerFlag_NotGainSkill) && player->getAddAttackSkill()) {			player->addSkillAdvance(SKILL_FIST, 1);		}		return true;	}	return false;}
开发者ID:d33tah,项目名称:forgottenserver,代码行数:33,


示例12: getPosition

bool Npc::getRandomStep(Direction& dir){	std::vector<Direction> dirList;	const Position& creaturePos = getPosition();	if (canWalkTo(creaturePos, NORTH)) {		dirList.push_back(NORTH);	}	if (canWalkTo(creaturePos, SOUTH)) {		dirList.push_back(SOUTH);	}	if (canWalkTo(creaturePos, EAST)) {		dirList.push_back(EAST);	}	if (canWalkTo(creaturePos, WEST)) {		dirList.push_back(WEST);	}	if (dirList.empty()) {		return false;	}	std::random_shuffle(dirList.begin(), dirList.end());	dir = dirList[uniform_random(0, dirList.size() - 1)];	return true;}
开发者ID:Jonas21,项目名称:forgottenserver,代码行数:29,


示例13: gettime

voidstabilize_manager::stabilize_continuous (u_int32_t t){  stabilize_continuous_tmo = NULL;  if (continuous_stabilizing ()) { // stabilizing too fast    t = 2 * t;    warnx << gettime () << " " << myID	  <<" stabilize_continuous: slow down " << t << "/n";  } else {    // Try to keep t around cts_timer_base    if (t >= cts_timer_base)   t -= stabilize_decrease_timer;    if (t <  cts_timer_base/2) t  = (int)(stabilize_slowdown_factor * t);    for (unsigned int i = 0; i < clients.size (); i++)      clients[i]->do_continuous ();  }  if (t > cts_timer_max)    t = cts_timer_max;  u_int32_t t1 = uniform_random (0.5 * t, 1.5 * t);  u_int32_t sec = t1 / 1000;  u_int32_t nsec =  (t1 % 1000) * 1000000;  continuous_timer = t;  stabilize_continuous_tmo =    delaycb (sec, nsec, wrap (this, 			      &stabilize_manager::stabilize_continuous, t));}
开发者ID:Amit-DU,项目名称:dht,代码行数:28,


示例14: getPosition

bool Npc::getRandomStep(Direction& dir) const{    std::vector<Direction> dirList;    const Position& creaturePos = getPosition();    if (canWalkTo(creaturePos, DIRECTION_NORTH)) {        dirList.push_back(DIRECTION_NORTH);    }    if (canWalkTo(creaturePos, DIRECTION_SOUTH)) {        dirList.push_back(DIRECTION_SOUTH);    }    if (canWalkTo(creaturePos, DIRECTION_EAST)) {        dirList.push_back(DIRECTION_EAST);    }    if (canWalkTo(creaturePos, DIRECTION_WEST)) {        dirList.push_back(DIRECTION_WEST);    }    if (dirList.empty()) {        return false;    }    dir = dirList[uniform_random(0, dirList.size() - 1)];    return true;}
开发者ID:marksamman,项目名称:forgottenserver,代码行数:28,


示例15: uniform_random

void Creature::onWalk(Direction& dir){	if (hasCondition(CONDITION_DRUNK)) {		uint32_t r = uniform_random(0, 20);		if (r <= 4) {			switch (r) {				case 0:					dir = NORTH;					break;				case 1:					dir = WEST;					break;				case 3:					dir = SOUTH;					break;				case 4:					dir = EAST;					break;				default:					break;			}			g_game.internalCreatureSay(this, SPEAK_MONSTER_SAY, "Hicks!", false);		}	}}
开发者ID:ArthurF5,项目名称:lforgottenserver,代码行数:27,


示例16: make_bulk_reply

reply_ptr make_bulk_reply(size_t size){    auto r = std::make_unique<reply>();    r->t = reply::bulk_type;    r->bulk = std::vector<char>(size);    std::generate(begin(r->bulk), end(r->bulk), []{ return static_cast<char>(uniform_random(0, 0xFF)); });    return r;}
开发者ID:summerlight,项目名称:redis-cpp,代码行数:8,


示例17: draw_random_curve

static cairo_time_tdraw_random_curve (cairo_t *cr, cairo_fill_rule_t fill_rule,		   int width, int height, int loops){    double x[3*NUM_SEGMENTS];    double y[3*NUM_SEGMENTS];    int i;    cairo_save (cr);    cairo_set_source_rgb (cr, 0, 0, 0);    cairo_paint (cr);    for (i = 0; i < 3*NUM_SEGMENTS; i++) {         x[i] = uniform_random (0, width);         y[i] = uniform_random (0, height);    }    state = 0x12345678;    cairo_translate (cr, 1, 1);    cairo_set_fill_rule (cr, fill_rule);    cairo_set_source_rgb (cr, 1, 0, 0);    cairo_new_path (cr);    cairo_move_to (cr, 0, 0);    for (i = 0; i < NUM_SEGMENTS; i++) {	cairo_curve_to (cr,			x[3*i+0], y[3*i+0],			x[3*i+1], y[3*i+1],			x[3*i+2], y[3*i+2]);    }    cairo_close_path (cr);    cairo_perf_timer_start ();    cairo_perf_set_thread_aware (cr, FALSE);    while (loops--) {	if (loops == 0)	    cairo_perf_set_thread_aware (cr, TRUE);        cairo_fill_preserve (cr);    }    cairo_perf_timer_stop ();    cairo_restore (cr);    return cairo_perf_timer_elapsed ();}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:46,


示例18: uniform_random

voidpmaint::start (){  if (active_cb)    return;  int jitter = uniform_random (0, PRTTMLONG);  active_cb = delaycb (PRTTMLONG + jitter, wrap (this, &pmaint::pmaint_next));}
开发者ID:UMKC-BigDataLab,项目名称:XGossip,代码行数:8,


示例19: uniform_random

 /**  * Seeds the values of this vector with a random point on the unit circle.  *  */ void vector_t::random() {         for( unsigned int i=0; i<_vec.size(); i++ )         _vec[i] = uniform_random();          double magn = norm();     for( unsigned int i=0; i<_vec.size(); i++ )         _vec[i] /= magn; }
开发者ID:rshnn,项目名称:baxter_planning,代码行数:13,


示例20: uniform_random

void ConditionOutfit::changeOutfit(Creature* creature, int32_t index /*= -1*/){	if (!outfits.empty()) {		if (index == -1) {			index = uniform_random(0, outfits.size() - 1);		}		Outfit_t outfit = outfits[index];		g_game.internalCreatureChangeOutfit(creature, outfit);	}}
开发者ID:A-Dirty-Rag,项目名称:forgottenserver,代码行数:11,


示例21: uniform_random

void Creature::onWalk(Direction& dir){	if (hasCondition(CONDITION_DRUNK)) {		uint32_t r = uniform_random(0, 20);		if (r <= DIRECTION_DIAGONAL_MASK) {			if (r < DIRECTION_DIAGONAL_MASK) {				dir = static_cast<Direction>(r);			}			g_game.internalCreatureSay(this, TALKTYPE_MONSTER_SAY, "Hicks!", false);		}	}}
开发者ID:A-Syntax,项目名称:forgottenserver,代码行数:12,


示例22: reset_doors

char* reset_doors(char* byob){               // Set the "good" door, use lots of entropy while doing it        unsigned good = (unsigned)uniform_random(3);                // setup the doors for the contestant to choose from        byob[good] = 1;        byob[(good+1) % 3] = 0;        byob[(good+2) % 3] = 0;                return byob;}
开发者ID:mmirabent,项目名称:monty,代码行数:12,


示例23: gaussian_random

double gaussian_random(double mean, double stddev) {  init_rand();#ifdef HAVE_LIBGSL  return mean + gsl_ran_gaussian(rng, stddev);#else  // Box-Muller algorithm to generate Gaussian from uniform  // see Knuth vol II algorithm P, sec. 3.4.1  double v1, v2, s;  do {    v1 = uniform_random(-1, 1);    v2 = uniform_random(-1, 1);    s = v1*v1 + v2*v2;  } while (s >= 1.0);  if (s == 0) {    return mean;  }  else {    return mean + v1 * sqrt(-2 * log(s) / s) * stddev;  }#endif}
开发者ID:LeiDai,项目名称:meep,代码行数:21,


示例24: onUsedAmmo

void WeaponDistance::onUsedAmmo(Player* player, Item* item, Tile* destTile) const{	if (ammoAction == AMMOACTION_MOVEBACK && breakChance > 0 && uniform_random(1, 100) <= breakChance) {		uint16_t newCount = item->getItemCount();		if (newCount > 0) {			newCount--;		}		g_game.transformItem(item, item->getID(), newCount);	} else {		Weapon::onUsedAmmo(player, item, destTile);	}}
开发者ID:d33tah,项目名称:forgottenserver,代码行数:13,


示例25: getElementDamage

int32_t WeaponMelee::getElementDamage(const Player* player, const Item* item) const{	int32_t attackSkill = player->getWeaponSkill(item);	int32_t attackValue = std::max<int32_t>(0, elementDamage);	float attackFactor = player->getAttackFactor();	int32_t maxValue = Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor);	if (uniform_random(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE)) {		maxValue *= 2;	}	maxValue = int32_t(maxValue * player->getVocation()->meleeDamageMultiplier);	return -normal_random(0, maxValue);}
开发者ID:tOgg1,项目名称:forgottenserver,代码行数:14,


示例26: mutation_function

void mutation_function(population& p){  for(auto i = p.begin(); i != p.end(); ++i)  {    float prob = 1 - i->adapt; // probability of mutation    float r = uniform_random(); // random float between <0,1)    if(r < prob)    {      mutation::random_transposition(i->perm);      i->eval = evaluation(i->perm); // after mutation is done we have to evaluate this specimen again    }  }}
开发者ID:pthomalla,项目名称:evo,代码行数:14,


示例27: do_wide_fills_va

static cairo_time_tdo_wide_fills_va (cairo_t *cr, int width, int height, int loops){    int count;    state = 0xc0ffee;    for (count = 0; count < 1000; count++) {	double x = floor (uniform_random (0, width));	double y = floor (uniform_random (0, height));	cairo_rectangle (cr, x, y, 5, ceil (uniform_random (0, height) - y));    }    cairo_perf_timer_start ();    while (loops--)	cairo_fill_preserve (cr);    cairo_perf_timer_stop ();    cairo_new_path (cr);    return cairo_perf_timer_elapsed ();}
开发者ID:AZed,项目名称:cairo,代码行数:23,


示例28: getFormulaValues

bool ConditionSpeed::startCondition(Creature* creature){	if (!Condition::startCondition(creature)) {		return false;	}	if (speedDelta == 0) {		int32_t min, max;		getFormulaValues(creature->getBaseSpeed(), min, max);		speedDelta = uniform_random(min, max);	}	g_game.changeSpeed(creature, speedDelta);	return true;}
开发者ID:A-Dirty-Rag,项目名称:forgottenserver,代码行数:15,


示例29: getManaCost

void Weapon::onUsedWeapon(Player* player, Item* item, Tile* destTile) const{	if (!player->hasFlag(PlayerFlag_NotGainSkill)) {		skills_t skillType;		uint32_t skillPoint;		if (getSkillType(player, item, skillType, skillPoint)) {			player->addSkillAdvance(skillType, skillPoint);		}	}	uint32_t manaCost = getManaCost(player);	if (manaCost != 0) {		player->addManaSpent(manaCost);		player->changeMana(-static_cast<int32_t>(manaCost));	}	if (!player->hasFlag(PlayerFlag_HasInfiniteSoul) && soul > 0) {		player->changeSoul(-static_cast<int32_t>(soul));	}	if (breakChance != 0 && uniform_random(1, 100) <= breakChance) {		decrementItemCount(item);		return;	}	switch (action) {		case WEAPONACTION_REMOVECOUNT:			decrementItemCount(item);			break;		case WEAPONACTION_REMOVECHARGE: {			uint16_t charges = item->getCharges();			if (charges > 1) {				g_game.transformItem(item, item->getID(), charges - 1);			} else {				g_game.internalRemoveItem(item);			}			break;		}		case WEAPONACTION_MOVE:			g_game.internalMoveItem(item->getParent(), destTile, INDEX_WHEREEVER, item, 1, nullptr, FLAG_NOLIMIT);			break;		default:			break;	}}
开发者ID:heltz,项目名称:maruim_server,代码行数:48,



注:本文中的uniform_random函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ unify函数代码示例
C++ unifi_trace函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。