本文整理汇总了C++中gd::Project::GetUsedPlatforms方法的典型用法代码示例。如果您正苦于以下问题:C++ Project::GetUsedPlatforms方法的具体用法?C++ Project::GetUsedPlatforms怎么用?C++ Project::GetUsedPlatforms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gd::Project
的用法示例。
在下文中一共展示了Project::GetUsedPlatforms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChooseAndAddBehaviorToObject
bool ChooseBehaviorTypeDialog::ChooseAndAddBehaviorToObject(wxWindow * parent, gd::Project & project, gd::Object * object, gd::Layout * layout, bool isGlobalObject)
{
gd::ChooseBehaviorTypeDialog dialog(parent, project);
if ( dialog.ShowModal() == 1)
{
//Find behavior metadata
std::shared_ptr<gd::PlatformExtension> extension = std::shared_ptr<gd::PlatformExtension> ();
std::vector < std::shared_ptr<gd::PlatformExtension> > extensions = project.GetCurrentPlatform().GetAllPlatformExtensions();
for (std::size_t i = 0;i<extensions.size();++i)
{
std::vector<gd::String> behaviorsTypes = extensions[i]->GetBehaviorsTypes();
if ( find(behaviorsTypes.begin(), behaviorsTypes.end(), dialog.GetSelectedBehaviorType()) != behaviorsTypes.end() )
extension = extensions[i];
}
gd::BehaviorMetadata metadata = extension->GetBehaviorMetadata(dialog.GetSelectedBehaviorType());
//Add behavior to object
gd::String autoName = metadata.GetDefaultName();
for (std::size_t j = 2;object->HasBehaviorNamed(autoName);++j)
autoName = metadata.GetDefaultName()+gd::String::From(j);
object->AddNewBehavior(project, dialog.GetSelectedBehaviorType(), autoName);
//Let the scene know about the new behavior
if ( isGlobalObject && layout )
layout->UpdateBehaviorsSharedData(project);
else //Scene pointer is NULL: Update shared data of all layouts
{
for (std::size_t i = 0;i<project.GetLayoutsCount();++i)
project.GetLayout(i).UpdateBehaviorsSharedData(project);
}
for (std::size_t j = 0; j < project.GetUsedPlatforms().size();++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnBehaviorAdded(project, isGlobalObject ? NULL : layout, *object, object->GetBehavior(autoName));
return true;
}
return false;
}
示例2: NotifyChangesInEventsOfExternalEvents
void EventsChangesNotifier::NotifyChangesInEventsOfExternalEvents(
gd::Project& project, gd::ExternalEvents& externalEvents) {
for (std::size_t j = 0; j < project.GetUsedPlatforms().size(); ++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnEventsModified(
project, externalEvents);
// Notify scenes, which include the external events ( even indirectly ), that
// their events has changed
for (std::size_t i = 0; i < project.GetLayoutsCount(); ++i) {
std::vector<gd::Layout*> notUsed;
std::vector<gd::ExternalEvents*> linkedExternalEvents;
GetScenesAndExternalEventsLinkedTo(project.GetLayout(i).GetEvents(),
project,
notUsed,
linkedExternalEvents);
for (std::size_t j = 0; j < linkedExternalEvents.size(); ++j) {
if (linkedExternalEvents[j]->GetName() == externalEvents.GetName()) {
for (std::size_t k = 0; k < project.GetUsedPlatforms().size(); ++k)
project.GetUsedPlatforms()[k]->GetChangesNotifier().OnEventsModified(
project,
project.GetLayout(i),
/*indirectChange=*/true,
externalEvents.GetName());
}
}
}
// Also notify external events
for (std::size_t i = 0; i < project.GetExternalEventsCount(); ++i) {
std::vector<gd::Layout*> notUsed;
std::vector<gd::ExternalEvents*> linkedExternalEvents;
GetScenesAndExternalEventsLinkedTo(project.GetExternalEvents(i).GetEvents(),
project,
notUsed,
linkedExternalEvents);
for (std::size_t j = 0; j < linkedExternalEvents.size(); ++j) {
if (linkedExternalEvents[j]->GetName() == externalEvents.GetName()) {
for (std::size_t k = 0; k < project.GetUsedPlatforms().size(); ++k)
project.GetUsedPlatforms()[k]->GetChangesNotifier().OnEventsModified(
project,
project.GetExternalEvents(i),
/*indirectChange=*/true,
externalEvents.GetName());
}
}
}
}
示例3: NotifyChangesInEventsOfScene
void EventsChangesNotifier::NotifyChangesInEventsOfScene(gd::Project& project,
gd::Layout& layout) {
for (std::size_t j = 0; j < project.GetUsedPlatforms().size(); ++j)
project.GetUsedPlatforms()[j]->GetChangesNotifier().OnEventsModified(
project, layout);
// Notify others scenes, which include the changed scene ( even indirectly ),
// that their events has changed
for (std::size_t i = 0; i < project.GetLayoutsCount(); ++i) {
if (&project.GetLayout(i) == &layout) continue;
std::vector<gd::Layout*> linkedScenes;
std::vector<gd::ExternalEvents*> notUsed;
GetScenesAndExternalEventsLinkedTo(
project.GetLayout(i).GetEvents(), project, linkedScenes, notUsed);
for (std::size_t j = 0; j < linkedScenes.size(); ++j) {
if (linkedScenes[j]->GetName() == layout.GetName()) {
for (std::size_t k = 0; k < project.GetUsedPlatforms().size(); ++k)
project.GetUsedPlatforms()[k]->GetChangesNotifier().OnEventsModified(
project,
project.GetLayout(i),
/*indirectChange=*/true,
layout.GetName());
}
}
}
// Also notify external events
for (std::size_t i = 0; i < project.GetExternalEventsCount(); ++i) {
std::vector<gd::Layout*> linkedScenes;
std::vector<gd::ExternalEvents*> notUsed;
GetScenesAndExternalEventsLinkedTo(project.GetExternalEvents(i).GetEvents(),
project,
linkedScenes,
notUsed);
for (std::size_t j = 0; j < linkedScenes.size(); ++j) {
if (linkedScenes[j]->GetName() == layout.GetName()) {
for (std::size_t k = 0; k < project.GetUsedPlatforms().size(); ++k)
project.GetUsedPlatforms()[k]->GetChangesNotifier().OnEventsModified(
project,
project.GetExternalEvents(i),
/*indirectChange=*/true,
layout.GetName());
}
}
}
}