mob_figment_of_doubt_AI(Creature* creature) : ScriptedAI(creature) { me->CastSpell(me, SPELL_GROW, false); Classes cl = Classes(me->GetInstanceScript()->GetData(TYPE_CLASS_FIGMENT)); if (cl <= CLASS_TANK) _class = cl; else _class = CLASS_DPS; }
{ gSystem->Load("./Classes"); // This is necessary with delayed header parsing until functions are fwd declared #ifdef ClingWorkAroundMissingDynamicScope #ifdef ClingWorkAroundFunctionForwardDeclarations gROOT->ProcessLine("#include \"classesFuncFwdDecl.h\""); #endif gSystem->Exit(!gROOT->ProcessLine("Classes();")); #else #ifdef ClingWorkAroundFunctionForwardDeclarations #include "classesFuncFwdDecl.h"; #endif gSystem->Exit(!Classes()); #endif }
//--------------------------------------------------------- bool CGrid_Class_Statistics_For_Polygons::Get_Classes(CSG_Grid *pGrid, CSG_Shapes *pPolygons) { m_Classes.Destroy(); //----------------------------------------------------- if( Parameters("GRID_VALUES")->asInt() == 0 ) { sLong iCell; CSG_Category_Statistics Classes(pGrid->Get_Type()); for(iCell=0; iCell<pGrid->Get_NCells(); iCell++) { if( !pGrid->is_NoData(iCell) ) { Classes += pGrid->asDouble(iCell); } } //------------------------------------------------- if( Classes.Get_Count() > 0 ) { Classes.Sort(); for(int iClass=0; iClass<Classes.Get_Count(); iClass++) { pPolygons->Add_Field(Classes.asString(iClass), SG_DATATYPE_Double); } m_Classes.Create(*Get_System(), SG_DATATYPE_Short); for(iCell=0; iCell<pGrid->Get_NCells(); iCell++) { m_Classes.Set_Value(iCell, pGrid->is_NoData(iCell) ? -1 : Classes.Get_Category(pGrid->asDouble(iCell))); } } } //----------------------------------------------------- else { int fNam, fMin, fMax; CSG_Table *pLUT = NULL; if( (pLUT = Parameters("GRID_LUT")->asTable()) != NULL ) { fNam = Parameters("GRID_LUT_NAM")->asInt(); fMin = Parameters("GRID_LUT_MIN")->asInt(); fMax = Parameters("GRID_LUT_MAX")->asInt(); if( fNam < 0 || fNam >= pLUT->Get_Field_Count() ) { fNam = fMin; } if( fMax < 0 || fMax >= pLUT->Get_Field_Count() ) { fMax = fMin; } } else if( DataObject_Get_Parameter(pGrid, "LUT") && (pLUT = DataObject_Get_Parameter(pGrid, "LUT")->asTable()) != NULL ) { fNam = 1; fMin = 3; fMax = 4; } //------------------------------------------------- if( pLUT && pLUT->Get_Count() > 0 ) { for(int iClass=0; iClass<pLUT->Get_Count(); iClass++) { pPolygons->Add_Field((*pLUT)[iClass].asString(fNam), SG_DATATYPE_Double); } m_Classes.Create(*Get_System(), SG_DATATYPE_Short); for(sLong iCell=0; iCell<pGrid->Get_NCells(); iCell++) { m_Classes.Set_Value(iCell, Get_Class(pGrid->asDouble(iCell), *pLUT, fMin, fMax)); } } } //----------------------------------------------------- return( m_Classes.is_Valid() ); }