// Ryzom - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . //---------------------------------------------------------------------------- #include "stdpch.h" #include "ais_actions.h" #include "ai_instance.h" #include "nel/misc/hierarchical_timer.h" /* #include "nel/misc/types_nl.h" #include "nel/misc/debug.h" #include "ai_entity_id.h" #include "ai_mgr.h" #include "ai_grp.h" #include "ai_mgr_fauna.h" #include "ai_grp_fauna.h" #include "ai_place_xyr.h" #include #include */ //#include "ais_actions.h" using namespace NLMISC; using namespace NLNET; using namespace std; using namespace CAISActionEnums; //---------------------------------------------------------------------------- // Singleton data instantiation //---------------------------------------------------------------------------- CAISActions *CAISActions::Instance=NULL; std::vector CContextStack::Stack; CAIInstance *CWorkPtr::Instance=NULL; CManager *CWorkPtr::Mgr=NULL; CGroup *CWorkPtr::Grp=NULL; CBot *CWorkPtr::Bot=NULL; CAIState *CWorkPtr::State=NULL; CAIStateProfile *CWorkPtr::Profile=NULL; CAIStateChat *CWorkPtr::Chat=NULL; CStateMachine *CWorkPtr::EventContainer=NULL; CContinent *CWorkPtr::Continent=NULL; CRegion *CWorkPtr::Region=NULL; CCellZone *CWorkPtr::CellZone=NULL; CCell *CWorkPtr::Cell=NULL; CFaunaZone *CWorkPtr::FaunaZone=NULL; CNpcZone *CWorkPtr::NpcZone=NULL; CRoad *CWorkPtr::Road=NULL; CRoadTrigger *CWorkPtr::RoadTrigger=NULL; //CGroupDesc *CWorkPtr::GroupDesc=NULL; //CBotDesc *CWorkPtr::BotDesc=NULL; COutpost *CWorkPtr::Outpost = NULL; //COutpostCharge *CWorkPtr::OutpostCharge = NULL; std::string CWorkPtr::SquadVariantName; //CGroupDesc *CWorkPtr::OutpostGroupDesc = NULL; //CBotDesc *CWorkPtr::OutpostBotDesc = NULL; IGroupDesc *CWorkPtr::GroupDesc=NULL; IBotDesc *CWorkPtr::BotDesc=NULL; CGroupFamily *CWorkPtr::GroupFamily = NULL; IAILogicAction *CWorkPtr::_LogicAction = NULL; std::map CWorkPtr::_LogicActionMap; //---------------------------------------------------------------------------- // Public methods //---------------------------------------------------------------------------- void CAISActions::begin(uint32 contextAlias) { // always repush the previous state. // if the stack is empty, push a global context if (CContextStack::size() == 0) { CContextStack::push(ContextGlobal); } else { CContextStack::push(CContextStack::topContext()); } } void CAISActions::end(uint32 contextAlias) { CContextStack::pop(); } void CAISActions::execute(uint64 action,const std::vector &args) { H_AUTO(CAISActions_execute); for (uint i=CContextStack::size();i--;) { TContext context=CContextStack::context(i); nlassert(context::iterator first(ChangedOutposts.begin()), last(ChangedOutposts.end()); for (; first != last; ++first) { CContinent *cont = *first; cont->relinkOutpost(); } } ChangedOutposts.clear(); */ }