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


C++ DynamicObject::getProperties方法代码示例

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


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

示例1: drawPlayerStats

//Update the player stats
void GUIGame::drawPlayerStats()
{
//	IVideoDriver * driver = App::getInstance()->getDevice()->getVideoDriver();
	// Text display
	// Update the GUI display
	DynamicObject* playerObject = DynamicObjectsManager::getInstance()->getPlayer();

	stringc playerLife;
	playerLife += playerObject->getProperties().life;
	playerLife += "/";
	playerLife += playerObject->getProperties().maxlife;
	playerLife += " Experience:";
	stringc playerxp = (stringc)playerObject->getProperties().experience;
	playerLife += playerxp;
	playerLife += " Level:";
	playerLife += playerObject->getProperties().level;
	//+(stringc)properties.experience;
	IGUIStaticText* text = (IGUIStaticText*)GUIManager::getInstance()->getGUIElement(GUIManager::ST_ID_PLAYER_LIFE);
	if (text)
		text->setText(((core::stringw)playerLife).c_str());
	
	s32 hp = DynamicObjectsManager::getInstance()->getPlayer()->getProperties().life;
	s32 max = DynamicObjectsManager::getInstance()->getPlayer()->getProperties().maxlife;
	CGUIGfxStatus* lifegauge = (CGUIGfxStatus*)GUIManager::getInstance()->getGUIElement(GUIManager::IMG_LIFEGAUGE);
	lifegauge->setCurrentValue(hp);
	lifegauge->setMaxValue(max);

	s32 mana = DynamicObjectsManager::getInstance()->getPlayer()->getProperties().mana;
	s32 maxmana = DynamicObjectsManager::getInstance()->getPlayer()->getProperties().maxmana;
	CGUIGfxStatus* managauge = (CGUIGfxStatus*)GUIManager::getInstance()->getGUIElement(GUIManager::IMG_MANAGAUGE);
	managauge->setCurrentValue(mana);
	managauge->setMaxValue(maxmana);
}
开发者ID:kcuzner,项目名称:irrrpgbuilder,代码行数:34,代码来源:CUIGame.cpp

示例2: getLatestComponents

bool Updater::getLatestComponents()
{
    URL url = URL(UPDATER_URL_PREFIX).getChildURL("latest.php")
        .withParameter("channel", launcherApplication::getConfig()->getString("updater", "channel"))
        .withParameter("platform", launcherApplication::getConfig()->getString("updater", "platform"))
        .withParameter("components", "launcher,tremulous");

    ScopedPointer<InputStream> stream(url.createInputStream(false, nullptr, nullptr, String(), 5000));
    if (stream == nullptr) {
        return false;
    }

    var versionsVar = JSON::parse(*stream);
    if (versionsVar == var::null || !versionsVar.isObject()) {
        return false;
    }

    DynamicObject *versionsObject = versionsVar.getDynamicObject();
    NamedValueSet *versionsSet = &versionsObject->getProperties();

    components.clear();
    for (int i = 0; i < versionsSet->size(); i++) {
        String componentName(versionsSet->getName(i));
        Launcher::Component component(componentName);
        component.setRemoteVersion(versionsSet->getValueAt(i).toString());
        components.add(component);
    }

    return true;
}
开发者ID:Foe-of-Eternity,项目名称:tremulous-launcher,代码行数:30,代码来源:Updater.cpp

示例3: save

void IniFile::save()
{
    const GenericScopedLock<CriticalSection> scopedlock(lock);
    String config;
    for (int i = 0; i < data.size(); i++) {
        String section(data.getName(i).toString());
        DynamicObject *sectionObject = data[section].getDynamicObject();
        NamedValueSet *sectionSet = &sectionObject->getProperties();

        if (sectionSet->size() == 0) {
            continue;
        }
        
        if (section != "__empty") {
            config += '[';
            config += section;
           #ifdef JUCE_WINDOWS
            config += "]\r\n";
           #else
            config += "]\n";
           #endif
        }

        for (int j = 0; j < sectionSet->size(); j++) {
            config += sectionSet->getName(j).toString();
            config += '=';
            config += sectionSet->getValueAt(j).toString();
           #ifdef JUCE_WINDOWS
            config += "\r\n";
           #else
            config += '\n';
           #endif
        }

       #ifdef JUCE_WINDOWS
        config += "\r\n";
       #else
        config += '\n';
       #endif
    }

    file.replaceWithText(config);
}
开发者ID:GrangerHub,项目名称:tremulous-launcher,代码行数:43,代码来源:IniFile.cpp

示例4: unset

void IniFile::unset(const String& section, const String& key)
{
    const GenericScopedLock<CriticalSection> scopedlock(lock);
    String realSection(section);
    if (realSection.isEmpty()) {
        realSection = "__empty";
    }
    
    if (!data.contains(realSection)) {
        return;
    }

    DynamicObject *sectionObject = data[realSection].getDynamicObject();
    sectionObject->removeProperty(key);
    
    if (realSection != "__empty" && sectionObject->getProperties().size() == 0) {
        data.remove(realSection);
    }
}
开发者ID:GrangerHub,项目名称:tremulous-launcher,代码行数:19,代码来源:IniFile.cpp


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