Exemplo n.º 1
0
    void Scan(const std::string &directory)
    {
        utf8 pattern[MAX_PATH];
        String::Set(pattern, sizeof(pattern), directory.c_str());
        Path::Append(pattern, sizeof(pattern), "*.sc6");

        IFileScanner * scanner = Path::ScanDirectory(pattern, true);
        while (scanner->Next())
        {
            auto path = scanner->GetPath();
            auto fileInfo = scanner->GetFileInfo();
            AddScenario(path, fileInfo->LastModified);
        }
        delete scanner;
    }
Exemplo n.º 2
0
bool CIATestMainWindow::InitWindow(IGameWindow *piParent,bool bPopup)
{
	bool bOk=CGameWindowBase::InitWindow(piParent,bPopup);
	if(bOk)
	{
		m_FrameManager.Attach("GameGUI","FrameManager");
	}
	if(bOk)
	{
		CVector vPos=CVector(dBaseSize/2.0,dBaseSize/2.0,dBaseSize*1.5);
		CVector vAngles=CVector(90,0,0);
		m_Viewport.Attach("GameGUI","Viewport");
		m_Viewport.m_piViewport->SetCaption("IA Test");
		m_Camera.Create("GameGUI","Camera","");
 		m_Camera.m_piCamera->SetPosition(vPos);
		m_Camera.m_piCamera->SetAngles(vAngles);

		SGameRect sRect;
		sRect.x=0;
		sRect.y=0;
		sRect.w=1;
		sRect.h=1;
		m_eReferenceSystem=eGameGUIReferenceSystem_Relative;
		SetRect(&sRect);

		m_piGUIManager->SetFocus(this);
	}

	ITestScenario *piDefaultScenario=NULL;
	AddScenario(new CTestScenarioSeek);
	AddScenario(new CTestScenarioFlee);
	AddScenario(new CTestScenarioArrive);
	AddScenario(new CTestScenarioPursue);
	AddScenario(new CTestScenarioEvade);
	AddScenario(new CTestScenarioWander);
	AddScenario(new CTestScenarioInterpose);
	AddScenario(piDefaultScenario=new CTestScenarioOffsetPursue);

	ActivateScenario(piDefaultScenario);

	return bOk;
}