123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- //
- // Python wrapper class for CySelectionGroup
- //
- //
- #include "CvGameCoreDLL.h"
- #include "CySelectionGroup.h"
- #include "CvSelectionGroup.h"
- #include "CvPlot.h"
- #include "CyPlot.h"
- #include "CvArea.h"
- #include "CyArea.h"
- #include "CyUnit.h"
- //#include "CvStructs.h"
- CySelectionGroup::CySelectionGroup() : m_pSelectionGroup(NULL)
- {
- }
- CySelectionGroup::CySelectionGroup(CvSelectionGroup* pSelectionGroup) : m_pSelectionGroup(pSelectionGroup)
- {
- }
- void CySelectionGroup::pushMission(MissionTypes eMission, int iData1, int iData2, int iFlags, bool bAppend, bool bManual, MissionAITypes eMissionAI, CyPlot* pMissionAIPlot, CyUnit* pMissionAIUnit)
- {
- if (m_pSelectionGroup)
- return m_pSelectionGroup->pushMission(eMission, iData1, iData2, iFlags, bAppend, bManual, eMissionAI, pMissionAIPlot->getPlot(), pMissionAIUnit->getUnit());
- }
- void CySelectionGroup::pushMoveToMission(int iX, int iY)
- {
- if (m_pSelectionGroup)
- return m_pSelectionGroup->pushMission(MISSION_MOVE_TO, iX, iY);
- }
- void CySelectionGroup::popMission()
- {
- if (m_pSelectionGroup)
- return m_pSelectionGroup->popMission();
- }
- CyPlot* CySelectionGroup::lastMissionPlot()
- {
- return m_pSelectionGroup ? new CyPlot(m_pSelectionGroup->lastMissionPlot()) : NULL;
- }
- bool CySelectionGroup::canStartMission(int iMission, int iData1, int iData2, CyPlot* pPlot, bool bTestVisible)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canStartMission(iMission, iData1, iData2, pPlot->getPlot(), bTestVisible) : false;
- }
- bool CySelectionGroup::canDoInterfaceMode(InterfaceModeTypes eInterfaceMode)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canDoInterfaceMode(eInterfaceMode) : false;
- }
- bool CySelectionGroup::canDoInterfaceModeAt(InterfaceModeTypes eInterfaceMode, CyPlot* pPlot)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canDoInterfaceModeAt(eInterfaceMode, pPlot->getPlot()) : false;
- }
- bool CySelectionGroup::canDoCommand(CommandTypes eCommand, int iData1, int iData2, bool bTestVisible)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canDoCommand(eCommand, iData1, iData2, bTestVisible) : false;
- }
- bool CySelectionGroup::isHuman()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->isHuman() : false;
- }
- int CySelectionGroup::baseMoves()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->baseMoves() : -1;
- }
- bool CySelectionGroup::canAllMove()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canAllMove() : false;
- }
- bool CySelectionGroup::isWaiting()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->isWaiting() : false;
- }
- bool CySelectionGroup::isFull()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->isFull() : false;
- }
- bool CySelectionGroup::hasCargo()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->hasCargo() : false;
- }
- bool CySelectionGroup::canAnyMove()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canAnyMove() : false;
- }
- bool CySelectionGroup::hasMoved()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->hasMoved() : false;
- }
- bool CySelectionGroup::canEnterTerritory(int /*TeamTypes*/ eTeam, bool bIgnoreRightOfPassage)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canEnterTerritory((TeamTypes) eTeam, bIgnoreRightOfPassage) : false;
- }
- bool CySelectionGroup::canEnterArea(int /*TeamTypes*/ eTeam, CyArea* pArea, bool bIgnoreRightOfPassage)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canEnterArea((TeamTypes) eTeam, pArea->getArea(), bIgnoreRightOfPassage) : false;
- }
- bool CySelectionGroup::canMoveInto(CyPlot* pPlot, bool bAttack)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canMoveInto(pPlot->getPlot(), bAttack) : false;
- }
- bool CySelectionGroup::canMoveOrAttackInto(CyPlot* pPlot, bool bDeclareWar)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canMoveOrAttackInto(pPlot->getPlot(), bDeclareWar) : false;
- }
- bool CySelectionGroup::canMoveThrough(CyPlot* pPlot)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canMoveThrough(pPlot->getPlot()) : false;
- }
- bool CySelectionGroup::canFight()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canFight() : false;
- }
- bool CySelectionGroup::canDefend()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->canDefend() : false;
- }
- bool CySelectionGroup::alwaysInvisible()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->alwaysInvisible() : false;
- }
- bool CySelectionGroup::isInvisible(int /*TeamTypes*/ eTeam)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->isInvisible((TeamTypes) eTeam) : false;
- }
- int CySelectionGroup::countNumUnitAIType(UnitAITypes eUnitAI)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->countNumUnitAIType(eUnitAI) : -1;
- }
- bool CySelectionGroup::hasWorker()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->hasWorker() : false;
- }
- /************************************************************************************************/
- /* BETTER_BTS_AI_MOD 11/30/08 jdog5000 */
- /* */
- /* General AI */
- /************************************************************************************************/
- bool CySelectionGroup::isStranded()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->isStranded() : false;
- }
- /************************************************************************************************/
- /* BETTER_BTS_AI_MOD END */
- /************************************************************************************************/
- bool CySelectionGroup::at(int iX, int iY)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->at(iX, iY) : false;
- }
- bool CySelectionGroup::atPlot(CyPlot* pPlot)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->atPlot(pPlot->getPlot()) : false;
- }
- CyPlot* CySelectionGroup::plot()
- {
- return m_pSelectionGroup ? new CyPlot( m_pSelectionGroup->plot() ) : NULL;
- }
- CyArea* CySelectionGroup::area()
- {
- return m_pSelectionGroup ? new CyArea( m_pSelectionGroup->area() ) : NULL;
- }
- int /*RouteTypes*/ CySelectionGroup::getBestBuildRoute(CyPlot* pPlot, BuildTypes* peBestBuild)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getBestBuildRoute(pPlot->getPlot(), peBestBuild) : -1;
- }
- bool CySelectionGroup::isAmphibPlot(CyPlot* pPlot)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->isAmphibPlot(pPlot->getPlot()) : false;
- }
- bool CySelectionGroup::readyToSelect(bool bAny)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->readyToSelect(bAny) : false;
- }
- bool CySelectionGroup::readyToMove(bool bAny)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->readyToMove(bAny) : false;
- }
- bool CySelectionGroup::readyToAuto()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->readyToAuto() : false;
- }
- int CySelectionGroup::getID()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getID() : -1;
- }
- int /*PlayerTypes*/ CySelectionGroup::getOwner()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getOwnerINLINE() : -1;
- }
- int /*TeamTypes*/ CySelectionGroup::getTeam()
- {
- return m_pSelectionGroup ? (TeamTypes) m_pSelectionGroup->getTeam() : -1;
- }
- int /*ActivityTypes*/ CySelectionGroup::getActivityType()
- {
- return m_pSelectionGroup ? (ActivityTypes) m_pSelectionGroup->getActivityType() : -1;
- }
- void CySelectionGroup::setActivityType(int /*ActivityTypes*/ eNewValue)
- {
- if (m_pSelectionGroup)
- m_pSelectionGroup->setActivityType((ActivityTypes) eNewValue);
- }
- int /*AutomateTypes*/ CySelectionGroup::getAutomateType()
- {
- return m_pSelectionGroup ? (AutomateTypes) m_pSelectionGroup->getAutomateType() : -1;
- }
- bool CySelectionGroup::isAutomated()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->isAutomated() : false;
- }
- void CySelectionGroup::setAutomateType(int /*AutomateTypes*/ eNewValue)
- {
- if (m_pSelectionGroup)
- m_pSelectionGroup->setAutomateType((AutomateTypes) eNewValue);
- }
- CyPlot* CySelectionGroup::getPathFirstPlot()
- {
- return m_pSelectionGroup ? new CyPlot(m_pSelectionGroup->getPathFirstPlot()) : NULL;
- }
- CyPlot* CySelectionGroup::getPathEndTurnPlot()
- {
- return m_pSelectionGroup ? new CyPlot(m_pSelectionGroup->getPathEndTurnPlot()) : NULL;
- }
- bool CySelectionGroup::generatePath(CyPlot* pFromPlot, CyPlot* pToPlot, int iFlags, bool bReuse, int* piPathTurns)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->generatePath(pFromPlot->getPlot(), pToPlot->getPlot(), iFlags, bReuse, piPathTurns) : false;
- }
- void CySelectionGroup::resetPath()
- {
- if (m_pSelectionGroup)
- m_pSelectionGroup->resetPath();
- }
- int CySelectionGroup::getNumUnits()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getNumUnits() : -1;
- }
- void CySelectionGroup::clearMissionQueue()
- {
- if (m_pSelectionGroup)
- m_pSelectionGroup->clearMissionQueue();
- }
- int CySelectionGroup::getLengthMissionQueue()
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getLengthMissionQueue() : -1;
- }
- MissionData* CySelectionGroup::getMissionFromQueue(int iIndex)
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getMissionFromQueue(iIndex) : NULL;
- }
- CyUnit* CySelectionGroup::getHeadUnit()
- {
- return m_pSelectionGroup ? new CyUnit(m_pSelectionGroup->getHeadUnit()) : NULL;
- }
- CyUnit* CySelectionGroup::getUnitAt(int index)
- {
- return m_pSelectionGroup ? new CyUnit(m_pSelectionGroup->getUnitAt(index)) : NULL;
- }
- int CySelectionGroup::getMissionType( int iNode )
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getMissionType(iNode) : -1;
- }
- int CySelectionGroup::getMissionData1( int iNode )
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getMissionData1( iNode ) : -1;
- }
- int CySelectionGroup::getMissionData2( int iNode )
- {
- return m_pSelectionGroup ? m_pSelectionGroup->getMissionData2( iNode ) : -1;
- }
|