コード例 #1
0
ファイル: EventBuffer.cpp プロジェクト: ebithril/ModelViewer
	void EventBuffer::AddEvent(const CU::GrowingArray<PoolPointer<Event>>& anEvent)
	{
		for (unsigned short i = 0; i < anEvent.Size(); i++)
		{
			myEvents.Add(anEvent[i]);
		}
	}
コード例 #2
0
ObjectData* Event::GetGameObject(const std::string& aName) const
{
    if (myRoom == nullptr || myGameWorld == nullptr)
    {
        return nullptr;
    }
    if (aName == "Self")
    {
        return myObjectData;
    }
    else if (aName == "None")
    {
        return nullptr;
    }
    CommonUtilities::GrowingArray<ObjectData*, unsigned int>* objects = myRoom->GetObjectList();
    for (unsigned int i = 0; i < objects->Size(); ++i)
    {
        if ((*objects)[i]->myName == aName)
        {
            return (*objects)[i];
        }

        if ((*objects)[i]->myChilds.GetIsInitialized() == true)
        {
            for (unsigned int j = 0; j < (*objects)[i]->myChilds.Size(); ++j)
            {
                ObjectData* data = GetGameObject(aName, (*objects)[i]);
                if (data != nullptr)
                {
                    return data;
                }
            }
        }
    }
    DL_DEBUG(("Couldn't find object named: " + aName).c_str());
    return nullptr;
}