当前位置: 首页>>代码示例>>C++>>正文


C++ Equipment类代码示例

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


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

示例1: Equipment

void Feats::on_btnNext_clicked()
{
    Equipment* s = new Equipment();
    _main->setCentralWidget(s);
    s->show();
    s->setMainWindow(_main);
}
开发者ID:wroy,项目名称:dndBuilder,代码行数:7,代码来源:feats.cpp

示例2: Equipment

void MainWindow::on_actionEquipment_triggered()
{
    Equipment* ar = new Equipment();
    this->setCentralWidget(ar);
    ar->show();
    ar->setMainWindow(this);
}
开发者ID:wroy,项目名称:dndBuilder,代码行数:7,代码来源:mainwindow.cpp

示例3: buyLargePotion

/**
 * @brief OknoBazaru::kupDuzaMiksture	Przeprowadza kupno dużej mikstury zdrowia.
 */
void MarketWindow::buyLargePotion()
{
	Equipment *equipment = player_->equipment();
	equipment->setLargePotions(equipment->largePotions() + 1);
	player_->setGold(player_->gold() - CENA_DUZEJ_MIKSTURY);

	playerWindow_->update();
	smallPotionCountLabel->setText(QString::number(player_->equipment()->largePotions()));

	largePotionButton->setEnabled(player_->gold() >= CENA_DUZEJ_MIKSTURY);
	smallPotionButton->setEnabled(player_->gold() >= CENA_MALEJ_MIKSTURY);
}
开发者ID:Soszu,项目名称:TheChroniclesOfAndaria,代码行数:15,代码来源:MarketWindow.cpp

示例4: tr

void EquipmentEditor::newEquipment()
{
   QString name = QInputDialog::getText(this, tr("Equipment name"),
                                          tr("Equipment name:"));
   if( name.isEmpty() )
      return;

   Equipment* e = Database::instance().newEquipment();
   e->setName( name );

   setEquipment(e);
   show();
}
开发者ID:Mackanzx,项目名称:brewtarget,代码行数:13,代码来源:EquipmentEditor.cpp

示例5: RETURN_IF_STR_EMPTY

bool ModelValidator::isValid(const Equipment& equipment, bool allowDefaults/* = false*/)
{
	RETURN_IF_STR_EMPTY(equipment.GetManufacturerName(), "Equipment Manufacturer Name");
	RETURN_IF_STR_EMPTY(equipment.GetManufacturerModelName(), "Equipment Manufacturer Model");

	if (!allowDefaults)
	{
		RETURN_IF_STR_EMPTY(equipment.GetManufacturerModelName(), "Manafacturer Model Name");
		RETURN_IF_STR_EMPTY(equipment.GetSoftwareVersion(), "Software Version");
	}

	return true;
}
开发者ID:Bella31,项目名称:annotation-and-image-markup,代码行数:13,代码来源:ModelValidator.cpp

示例6: dummy

void dummy() {
/*
*/
Equipment* component;
InventoryVisitor visitor;

component->Accept(visitor);
cout << "Inventory "
     << component->Name()
     << visitor.GetInventory();
/*
*/
}
开发者ID:ExceptVL,项目名称:MustRead,代码行数:13,代码来源:visitor.C

示例7: while

bool QEquipmentView::fromXML(QDomDocument & dom)
{
    //supprime le contenu en cours
    this->reset();

    //charge le contenu
    QDomElement el = dom.documentElement().firstChildElement();
    while(!el.isNull()){
        Equipment equip;
        equip.boundXML(el);
        this->addEquipment(equip);
        el = el.nextSiblingElement();
    }
    return QRESULT_OK();
}
开发者ID:Ace4teaM,项目名称:Arduino-Project,代码行数:15,代码来源:QEquipmentView.cpp

示例8: equipItem

/*
* Equips the item specified by itemToEquip
* returns true if the item was equiped
*/
bool Character::equipItem(Equipment itemToEquip) {
	int tempSlot = itemToEquip.getSlot();
	if (equipedItems[tempSlot] == 0) {
		*equipedItems[tempSlot] = itemToEquip;
		return true;
	}
	return false;
};
开发者ID:DTM0013,项目名称:tigerDev-SUD,代码行数:12,代码来源:Character.cpp

示例9: addEntityInventoryItem

bool Inventory::addEntityInventoryItem(int i, Entity* ii)
{
	if (slotList.size() < maxSlotListCount)
	{
		if (!hasEntityInventoryItem(i))
		{
			if (ii->getInventoryItem()->getType() == "INVENTORYEQUIPMENT")
			{//is equipment
				Equipment* eq = (Equipment*)ii->getInventoryItem()->getItem();
				if (eq->occupiesBody())
				{//is body armor
					if (getSlotBody() == nullptr || getSlotBody()->getInventoryItem()->getCost() < ii->getInventoryItem()->getCost())
					{//if new armor is better (more expensive)
						slot_body = i;
					}
				}
				else if (eq->occupiesHand())
				{
					if (eq->occupiesOffhand())
					{//normal weapon
						if (getSlotHand() == nullptr || getSlotHand()->getInventoryItem()->getCost() < ii->getInventoryItem()->getCost())
						{//if new weapon is better (more expensive)
							slot_hand = i;
						}
					}
				}
				else
				{//shield
					if (getSlotOffHand() == nullptr || getSlotOffHand()->getInventoryItem()->getCost() < ii->getInventoryItem()->getCost())
					{//if new shield is better (more expensive)
						slot_offhand = i;
					}
				}
			}
			int row = i / inventoryColumns + 1;
			int col = i % inventoryColumns + 1;
			ii->setX(xDrawPosition + col*ii->getInventoryItem()->getItem()->getSpriteWidth() + magicPadding);
			ii->setY(yDrawPosition + row*ii->getInventoryItem()->getItem()->getSpriteHeight() + magicPadding);
			slotList[i] = ii;
			return true;
		}
	}
	return false;
}
开发者ID:Capeguy,项目名称:GPAssignment2,代码行数:44,代码来源:Inventory.cpp

示例10: POST

void LogIntoLayer::clickLogInto(CCObject* pSender)
{
	map<string,string> post;
	post["api"] = "login";
	post["username"]=usernameText->getString();
	post["password"]=passwordText->getString();
	std::string jsonStr = POST(post);
	JsonBox::Value data;
	CCLOG(jsonStr.c_str());
	data.loadFromString(jsonStr);
	if(data["result"].getString()=="OK"){
		CCLOG("Login Successfully!");
		USER->setUserID(atoi(data["0"]["user_id"].getString().c_str()));
		USER->setUsername(data["0"]["username"].getString());
		USER->setPassword(data["0"]["password"].getString());
		USER->setLevel(atoi(data["0"]["level"].getString().c_str()));
		USER->setExp(atoi(data["0"]["exp"].getString().c_str()));
		USER->setBasicAGI(atoi(data["0"]["basic_agi"].getString().c_str()));
		USER->setBasicSTR(atoi(data["0"]["basic_str"].getString().c_str()));
		USER->setBasicDEF(atoi(data["0"]["basic_def"].getString().c_str()));
		Equipment* equipment = new Equipment();
		equipment->setWeapon(Weapon(atoi(data["0"]["current_weapon"].getString().c_str())));
		equipment->setBase(Base(atoi(data["0"]["current_base"].getString().c_str())));
		equipment->setPlate(Plate(atoi(data["0"]["current_plate"].getString().c_str())));//
		USER->setOpenChaptersNumber(atoi(data["0"]["open_chapters_number"].getString().c_str()));
		USER->setWinOnlineGamesNumber(atoi(data["0"]["win_online_game_number"].getString().c_str()));
		USER->setPlayOnlineGamesNumber(atoi(data["0"]["play_online_game_number"].getString().c_str()));
		USER->setMoney(atoi(data["0"]["money"].getString().c_str()));
		CCLOG(data["0"]["money"].getString().c_str());
		USER->setHonor(atoi(data["0"]["honor"].getString().c_str()));
		USER->setHasSignin(true);
		USER->setIsBeginner(false);
		USER->flush();
		CCNode* parent = this->getParent();
		this->removeFromParentAndCleanup();
		INFORMATION_BOX("Login successfully!",parent);
	}
	else{
		PopWindowsLayer::createInfomationBox("Login failed!",this);
	}
}
开发者ID:cruisehu,项目名称:PongPongPia,代码行数:41,代码来源:LogIntoLayer.cpp

示例11: LoadEquipment

void ItemFactory::LoadItem(Item::ItemType type, int id, Item* item)
{
    if(item->GetItemType() == Item::ItemTypeEquipment)
    {
        Equipment* equipment = (Equipment*)item;
        LoadEquipment(equipment->GetEquipmentPosition(), id, equipment);
    }
    else
    {
        switch(id)
        {
            //TODO: Init Item with Id itemId

        default:
            std::string msg("Invalid ItemId ");
            msg.append(std::to_string(id));
            msg.append(" given in LoadItem.");
            throw GenericException(msg);
        }
    }
}
开发者ID:Panzareon,项目名称:RoguePG,代码行数:21,代码来源:ItemFactory.cpp

示例12: unequipItem

/**
 * @brief zdejmijPrzedmiot	W miarę możliwości zdejmuje dany przedmiot z gracza.
 * @param rzecz		Przedmiot do zdjęcia
 * @param gracz		gracz, który zdjejmuje przedmiot
 */
void unequipItem(const Item *item, Player *player)
{
	if (!isEquipped(item, player) || item == nullptr)
		return;

	Equipment *equipment = player->equipment();

	switch (item->type()) {
	case bronDwureczna:
	case bronJednoreczna:
		equipment->setRightHand(nullptr);
		break;
	case tarcza:
		equipment->setLeftHand(nullptr);
		break;
	case pancerz:
		equipment->setTorso(nullptr);
		break;
	case helm:
		equipment->setHead(nullptr);
		break;
	case artefakt:
		equipment->removeArtifact(item);
		break;
	default:
		qDebug() << QString::fromUtf8("Próbowano założyć nierozpoznany rodzaj ekwipunku.");
	}

	deactivateBonus(item, player);
}
开发者ID:Tommalla,项目名称:KronikiAndarii,代码行数:35,代码来源:EquipmentManagement.cpp

示例13: buy

/**
 * @brief OknoBazaru::kup	Kupuje lub sprzedaje aktualnie zaznaczony przedmiot z listy przedmiotów na					bazarze.
 */
void MarketWindow::buy()
{
	Equipment *equipment = player_->equipment();
	if (buyButton->text() == sellText) {
		const Item *item = equipment->backpack().at(playerItemList->currentRow());
		unequipItem(item, player_);

		equipment->removeItem(item);
		wares_.push_back(item);
		player_->setGold(player_->gold() + item->value() / 2);
	} else {
		const Item *item = wares_.at(wareList->currentRow());
		if (player_->gold() < item->value())
			return;
		equipment->addItem(item);

		wares_.removeAt(wares_.indexOf(item));
		player_->setGold(player_->gold() - item->value());
	}
	populateListWidgets();
	playerWindow_->update();
	largePotionButton->setEnabled(player_->gold() >= CENA_DUZEJ_MIKSTURY);
	smallPotionButton->setEnabled(player_->gold() >= CENA_MALEJ_MIKSTURY);
}
开发者ID:Soszu,项目名称:TheChroniclesOfAndaria,代码行数:27,代码来源:MarketWindow.cpp

示例14: clear

void EquipmentEditor::showChanges()
{
   Equipment *e = obsEquip;
   if( e == 0 )
   {
      clear();
      return;
   }

   // Get weight and volume units for grain absorption.
   Unit* weightUnit = 0;
   Unit* volumeUnit = 0;
   Brewtarget::getThicknessUnits( &volumeUnit, &weightUnit );
   label_absorption->setText(tr("Grain absorption (%1/%2)").arg(volumeUnit->getUnitName()).arg(weightUnit->getUnitName()));

   //equipmentComboBox->setIndexByEquipment(e);

   lineEdit_name->setText(e->name());
   lineEdit_name->setCursorPosition(0);
   lineEdit_boilSize->setText(e);
   checkBox_calcBoilVolume->blockSignals(true); // Keep next line from emitting a signal and changing e.
   checkBox_calcBoilVolume->setCheckState( (e->calcBoilVolume())? Qt::Checked : Qt::Unchecked );
   checkBox_calcBoilVolume->blockSignals(false);
   lineEdit_batchSize->setText(e);

   lineEdit_tunVolume->setText(e);
   lineEdit_tunWeight->setText(e);
   lineEdit_tunSpecificHeat->setText(e);

   lineEdit_boilTime->setText(e);
   lineEdit_evaporationRate->setText(e);
   lineEdit_topUpKettle->setText(e);
   lineEdit_topUpWater->setText(e);

   lineEdit_trubChillerLoss->setText(e);
   lineEdit_lauterDeadspace->setText(e);

   textEdit_notes->setText( e->notes() );

   double gaCustomUnits = e->grainAbsorption_LKg() * volumeUnit->fromSI(1.0) * weightUnit->toSI(1.0);
   lineEdit_grainAbsorption->setText(gaCustomUnits);

   lineEdit_boilingPoint->setText(e);

   lineEdit_hopUtilization->setText(e);
   checkBox_defaultEquipment->blockSignals(true);
   if ( Brewtarget::option("defaultEquipmentKey",-1) == e->key() )
      checkBox_defaultEquipment->setCheckState(Qt::Checked);
   else
      checkBox_defaultEquipment->setCheckState(Qt::Unchecked);
   checkBox_defaultEquipment->blockSignals(false);
}
开发者ID:Mackanzx,项目名称:brewtarget,代码行数:52,代码来源:EquipmentEditor.cpp

示例15: equipItem

/**
 * @brief zalozPrzedmiot	W miarę możliwości zakłada dany przedmiot na gracza
 * @param rzecz		przedmiot do założenia
 * @param gracz		gracz, który zakłada przedmiot
 */
void equipItem(const Item *item, Player *player)
{
	Equipment *equipment = player->equipment();

	if (item == nullptr || isEquipped(item, player) || (item->type() == artefakt && equipment->usedArtifacts().size() >= Item::ArtifactLimit))
		return;

	switch (item->type()) {
	case bronDwureczna:
		unequipItem(equipment->rightHand(), player);
		unequipItem(equipment->leftHand(), player);
		equipment->setRightHand(item);
		break;
	case bronJednoreczna:
		unequipItem(equipment->rightHand(), player);
		equipment->setRightHand(item);
		break;
	case tarcza:
		if (equipment->rightHand()->type() == bronDwureczna)
			unequipItem(equipment->rightHand(), player);
		unequipItem(equipment->leftHand(), player);
		equipment->setLeftHand(item);
		break;
	case pancerz:
		unequipItem(equipment->torso(), player);
		equipment->setTorso(item);
		break;
	case helm:
		unequipItem(equipment->head(), player);
		equipment->setHead(item);
		break;
	case artefakt:
		if (equipment->usedArtifacts().size() < Item::ArtifactLimit)
			equipment->addArtifact(item);
	case mikstura:
		qDebug() << "Proba zalozenia mikstury";
	}

	activateBonus(item, player);
}
开发者ID:Tommalla,项目名称:KronikiAndarii,代码行数:45,代码来源:EquipmentManagement.cpp


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