示例#1
0
CurrencyValue CEconomyType::RinHackInc (CSpaceObject *pObj, CurrencyValue iInc)

//	RinHackInc
//
//	Increment rin

	{
	CShip *pPlayerShip = pObj->AsShip();
	IShipController *pController = (pPlayerShip ? pPlayerShip->GetController() : NULL);
	CCurrencyBlock *pMoney = (pController ? pController->GetCurrencyBlock() : NULL);
	return (pMoney ? pMoney->IncCredits(CONSTLIT("rin"), iInc) : 0);
	}
示例#2
0
void CEconomyType::RinHackSet (CSpaceObject *pObj, const CString &sData)

//	RinHackSet
//
//	Sets rin

	{
	CShip *pPlayerShip = pObj->AsShip();
	IShipController *pController = (pPlayerShip ? pPlayerShip->GetController() : NULL);
	CCurrencyBlock *pMoney = (pController ? pController->GetCurrencyBlock() : NULL);
	if (pMoney)
		pMoney->SetCredits(CONSTLIT("rin"), strToInt(sData, 0));
	}
示例#3
0
CString CEconomyType::RinHackGet (CSpaceObject *pObj)

//	RinHackGet
//
//	In previous version we used to store rin as object data on the player ship
//	This hack returns it from the proper place

	{
	CShip *pPlayerShip = pObj->AsShip();
	IShipController *pController = (pPlayerShip ? pPlayerShip->GetController() : NULL);
	CCurrencyBlock *pMoney = (pController ? pController->GetCurrencyBlock() : NULL);
	return (pMoney ? strFromInt((int)pMoney->GetCredits(CONSTLIT("rin"))) : NULL_STR);
	}