本文整理汇总了C++中CyArgsList::makeFunctionArgs方法的典型用法代码示例。如果您正苦于以下问题:C++ CyArgsList::makeFunctionArgs方法的具体用法?C++ CyArgsList::makeFunctionArgs怎么用?C++ CyArgsList::makeFunctionArgs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CyArgsList
的用法示例。
在下文中一共展示了CyArgsList::makeFunctionArgs方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getBugOptionINT
int getBugOptionINT(const char* id, int iDefault, const char* xmlKey)
{
CyArgsList argsList;
long lResult = 0;
argsList.add(id);
argsList.add(iDefault);
gDLL->getPythonIFace()->callFunction(PYBugOptionsModule, "getOptionINT", argsList.makeFunctionArgs(), &lResult);
return lResult;
}
示例2: getBugOptionBOOL
bool getBugOptionBOOL(const char* id, bool bDefault, const char* xmlKey)
{
CyArgsList argsList;
long lResult = 0;
argsList.add(id);
argsList.add(bDefault);
gDLL->getPythonIFace()->callFunction(PYBugOptionsModule, "getOptionBOOL", argsList.makeFunctionArgs(), &lResult);
return lResult != 0;
}
示例3: Execute
void CvNetAddReminder::Execute()
{
if (m_ePlayer != NO_PLAYER)
{
CyArgsList argsList;
long lResult = 0;
argsList.add(m_ePlayer);
argsList.add(m_iGameTurn);
argsList.add(m_szMessage.c_str());
gDLL->getPythonIFace()->callFunction(PYCivModule, "netAddReminder", argsList.makeFunctionArgs(), &lResult);
}
}
示例4: postEvent
bool CvDllPythonEvents::postEvent(CyArgsList& eventData)
{
eventData.add(GC.getGameINLINE().isDebugMode());
eventData.add(false);
eventData.add(gDLL->altKey());
eventData.add(gDLL->ctrlKey());
eventData.add(gDLL->shiftKey());
eventData.add(gDLL->getChtLvl() > 0);
long lResult = -1;
bool bOK = gDLL->getPythonIFace()->callFunction(PYEventModule, "onEvent", eventData.makeFunctionArgs(), &lResult);
return (bOK && lResult==1);
}
示例5: addBonuses
void CvMapGenerator::addBonuses()
{
PROFILE("CvMapGenerator::addBonuses");
gDLL->NiTextOut("Adding Bonuses...");
if (gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "addBonuses", NULL))
{
if (!gDLL->getPythonIFace()->pythonUsingDefaultImpl())
{
return; // Python override
}
}
for (int iOrder = 0; iOrder < GC.getNumBonusInfos(); iOrder++)
{
for (int iI = 0; iI < GC.getNumBonusInfos(); iI++)
{
gDLL->callUpdater();
if (GC.getBonusInfo((BonusTypes)iI).getPlacementOrder() == iOrder)
{
CyArgsList argsList;
argsList.add(iI);
if (!gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "addBonusType", argsList.makeFunctionArgs()) || gDLL->getPythonIFace()->pythonUsingDefaultImpl())
{
if (GC.getBonusInfo((BonusTypes)iI).isOneArea())
{
addUniqueBonusType((BonusTypes)iI);
}
else
{
addNonUniqueBonusType((BonusTypes)iI);
}
}
}
}
}
}
示例6: canPlaceBonusAt
bool CvMapGenerator::canPlaceBonusAt(BonusTypes eBonus, int iX, int iY, bool bIgnoreLatitude)
{
PROFILE_FUNC();
CvArea* pArea;
CvPlot* pPlot;
CvPlot* pLoopPlot;
int iRange;
int iDX, iDY;
int iI;
pPlot = GC.getMapINLINE().plotINLINE(iX, iY);
pArea = pPlot->area();
if (!(pPlot->canHaveBonus(eBonus, bIgnoreLatitude)))
{
return false;
}
long result = 0;
CyPlot kPlot = CyPlot(pPlot);
CyArgsList argsList;
argsList.add(gDLL->getPythonIFace()->makePythonObject(&kPlot));
if (gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "canPlaceBonusAt", argsList.makeFunctionArgs(), &result))
{
if (!gDLL->getPythonIFace()->pythonUsingDefaultImpl())
{
if (result >= 0)
{
return result;
}
else
{
FAssertMsg(false, "canPlaceBonusAt() must return >= 0");
}
}
}
for (iI = 0; iI < NUM_DIRECTION_TYPES; iI++)
{
pLoopPlot = plotDirection(iX, iY, ((DirectionTypes)iI));
if (pLoopPlot != NULL)
{
if ((pLoopPlot->getBonusType() != NO_BONUS) && (pLoopPlot->getBonusType() != eBonus))
{
return false;
}
}
}
CvBonusInfo& pInfo = GC.getBonusInfo(eBonus);
CvBonusClassInfo& pClassInfo = GC.getBonusClassInfo((BonusClassTypes) pInfo.getBonusClassType());
if (pPlot->isWater())
{
if (((GC.getMapINLINE().getNumBonusesOnLand(eBonus) * 100) / (GC.getMapINLINE().getNumBonuses(eBonus) + 1)) < pInfo.getMinLandPercent())
{
return false;
}
}
// Make sure there are no bonuses of the same class (but a different type) nearby:
iRange = pClassInfo.getUniqueRange();
for (iDX = -(iRange); iDX <= iRange; iDX++)
{
for (iDY = -(iRange); iDY <= iRange; iDY++)
{
pLoopPlot = plotXY(iX, iY, iDX, iDY);
if (pLoopPlot != NULL)
{
if (pLoopPlot->area() == pArea)
{
if (plotDistance(iX, iY, pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE()) <= iRange)
{
BonusTypes eOtherBonus = pLoopPlot->getBonusType();
if (eOtherBonus != NO_BONUS)
{
if (GC.getBonusInfo(eOtherBonus).getBonusClassType() == pInfo.getBonusClassType())
{
return false;
}
}
}
}
}
}
}
// Make sure there are none of the same bonus nearby:
iRange = pInfo.getUniqueRange();
for (iDX = -(iRange); iDX <= iRange; iDX++)
{
for (iDY = -(iRange); iDY <= iRange; iDY++)
{
//.........这里部分代码省略.........
示例7: doRiver
// pStartPlot = the plot at whose SE corner the river is starting
//
void CvMapGenerator::doRiver(CvPlot *pStartPlot, CardinalDirectionTypes eLastCardinalDirection, CardinalDirectionTypes eOriginalCardinalDirection, int iThisRiverID)
{
if (iThisRiverID == -1)
{
iThisRiverID = GC.getMapINLINE().getNextRiverID();
GC.getMapINLINE().incrementNextRiverID();
}
int iOtherRiverID = pStartPlot->getRiverID();
if (iOtherRiverID != -1 && iOtherRiverID != iThisRiverID)
{
return; // Another river already exists here; can't branch off of an existing river!
}
CvPlot *pRiverPlot = NULL;
CvPlot *pAdjacentPlot = NULL;
CardinalDirectionTypes eBestCardinalDirection = NO_CARDINALDIRECTION;
if (eLastCardinalDirection==CARDINALDIRECTION_NORTH)
{
pRiverPlot = pStartPlot;
if (pRiverPlot == NULL)
{
return;
}
pAdjacentPlot = plotCardinalDirection(pRiverPlot->getX_INLINE(), pRiverPlot->getY_INLINE(), CARDINALDIRECTION_EAST);
if ((pAdjacentPlot == NULL) || pRiverPlot->isWOfRiver() || pRiverPlot->isWater() || pAdjacentPlot->isWater())
{
return;
}
pStartPlot->setRiverID(iThisRiverID);
pRiverPlot->setWOfRiver(true, eLastCardinalDirection);
pRiverPlot = plotCardinalDirection(pRiverPlot->getX_INLINE(), pRiverPlot->getY_INLINE(), CARDINALDIRECTION_NORTH);
}
else if (eLastCardinalDirection==CARDINALDIRECTION_EAST)
{
pRiverPlot = plotCardinalDirection(pStartPlot->getX_INLINE(), pStartPlot->getY_INLINE(), CARDINALDIRECTION_EAST);
if (pRiverPlot == NULL)
{
return;
}
pAdjacentPlot = plotCardinalDirection(pRiverPlot->getX_INLINE(), pRiverPlot->getY_INLINE(), CARDINALDIRECTION_SOUTH);
if ((pAdjacentPlot == NULL) || pRiverPlot->isNOfRiver() || pRiverPlot->isWater() || pAdjacentPlot->isWater())
{
return;
}
pStartPlot->setRiverID(iThisRiverID);
pRiverPlot->setNOfRiver(true, eLastCardinalDirection);
}
else if (eLastCardinalDirection==CARDINALDIRECTION_SOUTH)
{
pRiverPlot = plotCardinalDirection(pStartPlot->getX_INLINE(), pStartPlot->getY_INLINE(), CARDINALDIRECTION_SOUTH);
if (pRiverPlot == NULL)
{
return;
}
pAdjacentPlot = plotCardinalDirection(pRiverPlot->getX_INLINE(), pRiverPlot->getY_INLINE(), CARDINALDIRECTION_EAST);
if ((pAdjacentPlot == NULL) || pRiverPlot->isWOfRiver() || pRiverPlot->isWater() || pAdjacentPlot->isWater())
{
return;
}
pStartPlot->setRiverID(iThisRiverID);
pRiverPlot->setWOfRiver(true, eLastCardinalDirection);
}
else if (eLastCardinalDirection==CARDINALDIRECTION_WEST)
{
pRiverPlot = pStartPlot;
if (pRiverPlot == NULL)
{
return;
}
pAdjacentPlot = plotCardinalDirection(pRiverPlot->getX_INLINE(), pRiverPlot->getY_INLINE(), CARDINALDIRECTION_SOUTH);
if ((pAdjacentPlot == NULL) || pRiverPlot->isNOfRiver() || pRiverPlot->isWater() || pAdjacentPlot->isWater())
{
return;
}
pStartPlot->setRiverID(iThisRiverID);
pRiverPlot->setNOfRiver(true, eLastCardinalDirection);
pRiverPlot = plotCardinalDirection(pRiverPlot->getX_INLINE(), pRiverPlot->getY_INLINE(), CARDINALDIRECTION_WEST);
}
else
{
//FAssertMsg(false, "Illegal direction type");
// River is starting here, set the direction in the next step
pRiverPlot = pStartPlot;
long result = 0;
CyPlot kPlot = CyPlot(pRiverPlot);
CyArgsList argsList;
argsList.add(gDLL->getPythonIFace()->makePythonObject(&kPlot));
if (gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "getRiverStartCardinalDirection", argsList.makeFunctionArgs(), &result))
{
//.........这里部分代码省略.........
示例8: canPlaceGoodyAt
bool CvMapGenerator::canPlaceGoodyAt(ImprovementTypes eImprovement, int iX, int iY)
{
PROFILE_FUNC();
CvPlot* pPlot;
FAssertMsg(eImprovement != NO_IMPROVEMENT, "Improvement is not assigned a valid value");
FAssertMsg(GC.getImprovementInfo(eImprovement).isGoody(), "ImprovementType eImprovement is expected to be a goody");
if (GC.getGameINLINE().isOption(GAMEOPTION_NO_GOODY_HUTS))
{
return false;
}
pPlot = GC.getMapINLINE().plotINLINE(iX, iY);
if (!(pPlot->canHaveImprovement(eImprovement, NO_TEAM)))
{
return false;
}
long result = 0;
CyPlot kPlot = CyPlot(pPlot);
CyArgsList argsList;
argsList.add(gDLL->getPythonIFace()->makePythonObject(&kPlot));
if (gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "canPlaceGoodyAt", argsList.makeFunctionArgs(), &result))
{
if (!gDLL->getPythonIFace()->pythonUsingDefaultImpl()) // Python override
{
if (result >= 0)
{
return result;
}
else
{
FAssertMsg(false, "python canPlaceGoodyAt() must return >= 0");
}
}
}
if (pPlot->getImprovementType() != NO_IMPROVEMENT)
{
return false;
}
if (pPlot->getBonusType() != NO_BONUS)
{
return false;
}
if (pPlot->isImpassable())
{
return false;
}
int iUniqueRange = GC.getImprovementInfo(eImprovement).getGoodyUniqueRange();
for (int iDX = -iUniqueRange; iDX <= iUniqueRange; iDX++)
{
for (int iDY = -iUniqueRange; iDY <= iUniqueRange; iDY++)
{
CvPlot *pLoopPlot = plotXY(iX, iY, iDX, iDY);
if (pLoopPlot != NULL && pLoopPlot->getImprovementType() == eImprovement)
{
return false;
}
}
}
return true;
}
示例9: getRiverValueAtPlot
int CvMapGenerator::getRiverValueAtPlot(CvPlot* pPlot)
{
CvPlot* pAdjacentPlot;
CvRandom riverRand;
int iSum;
int iI;
FAssert(pPlot != NULL);
long result = 0;
CyPlot kPlot = CyPlot(pPlot);
CyArgsList argsList;
argsList.add(gDLL->getPythonIFace()->makePythonObject(&kPlot));
if (gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "getRiverAltitude", argsList.makeFunctionArgs(), &result))
{
if (!gDLL->getPythonIFace()->pythonUsingDefaultImpl()) // Python override
{
if (result >= 0)
{
return result;
}
else
{
FAssertMsg(false, "python getRiverAltitude() must return >= 0");
}
}
}
iSum = result;
iSum += ((NUM_PLOT_TYPES - pPlot->getPlotType()) * 20);
for (iI = 0; iI < NUM_DIRECTION_TYPES; iI++)
{
pAdjacentPlot = plotDirection(pPlot->getX_INLINE(), pPlot->getY_INLINE(), ((DirectionTypes)iI));
if (pAdjacentPlot != NULL)
{
iSum += (NUM_PLOT_TYPES - pAdjacentPlot->getPlotType());
}
else
{
iSum += (NUM_PLOT_TYPES * 10);
}
}
riverRand.init((pPlot->getX_INLINE() * 43251267) + (pPlot->getY_INLINE() * 8273903));
iSum += (riverRand.get(10, "River Rand"));
return iSum;
}