本文整理汇总了C++中gd::Project::CreateEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ Project::CreateEvent方法的具体用法?C++ Project::CreateEvent怎么用?C++ Project::CreateEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gd::Project
的用法示例。
在下文中一共展示了Project::CreateEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnserializeEventsFrom
void EventsListSerialization::UnserializeEventsFrom(gd::Project & project, EventsList & list, const SerializerElement & events)
{
events.ConsiderAsArrayOf("event", "Event");
for(unsigned int i = 0; i<events.GetChildrenCount(); ++i)
{
SerializerElement & eventElem = events.GetChild(i);
std::string type = eventElem.GetChild("type", 0, "Type").GetValue().GetString();
gd::BaseEventSPtr event = project.CreateEvent(type);
if ( event != std::shared_ptr<gd::BaseEvent>())
event->UnserializeFrom(project, eventElem);
else
{
std::cout << "WARNING: Unknown event of type " << type << std::endl;
event = std::shared_ptr<gd::BaseEvent>(new EmptyEvent);
}
event->SetDisabled(eventElem.GetBoolAttribute("disabled"));
event->folded = eventElem.GetBoolAttribute("folded");
list.InsertEvent(event, list.GetEventsCount());
}
}