OTPurse::OTPurse(const OTPurse & thePurse) : OTContract() { InitPurse(); m_ServerID = thePurse.GetServerID(); m_AssetID = thePurse.GetAssetID(); }
OTToken::OTToken(const OTPurse & thePurse) : OTInstrument() { InitToken(); // These are in the parent class, OTInstrument. // I set them here because the "Purse" argument only exists // in this subclass constructor, not the base. m_ServerID = thePurse.GetServerID(); m_AssetTypeID = thePurse.GetAssetID(); }
OTToken::OTToken(const OTPurse & thePurse) : ot_super(), m_bPasswordProtected(false), m_lDenomination(0), m_nTokenCount(0), m_nChosenIndex(0), m_nSeries(0), m_State(blankToken), m_bSavePrivateKeys(false) { InitToken(); // These are in the parent class, OTInstrument. // I set them here because the "Purse" argument only exists // in this subclass constructor, not the base. m_ServerID = thePurse.GetServerID(); m_AssetTypeID = thePurse.GetAssetID(); }
bool OTPayment::SetTempValuesFromPurse(const OTPurse & theInput) { if (OTPayment::PURSE == m_Type) { m_bAreTempValuesSet = true; m_bHasRecipient = theInput.IsNymIDIncluded(); m_bHasRemitter = false; // ------------------------- m_lAmount = theInput.GetTotalValue(); m_lTransactionNum = 0; // (A purse has no transaction number.) // ------------------------- m_strMemo.Release(); // So far there's no purse memo (could add it, though.) // ------------------------- m_AssetTypeID = theInput.GetAssetID(); m_ServerID = theInput.GetServerID(); // ---------------------------- m_SenderUserID.Release(); m_SenderAcctID.Release(); // ---------------------------- if (!m_bHasRecipient || !theInput.GetNymID(m_RecipientUserID)) { m_bHasRecipient = false; m_RecipientUserID.Release(); } // ---------------------------- m_RecipientAcctID.Release(); // -------------------------------- m_RemitterUserID.Release(); // ---------------------------- // NOTE: Have to iterate the tokens and choose which date we want from each, // and then decide how to best express that here. // m_VALID_FROM = theInput.GetValidFrom(); // m_VALID_TO = theInput.GetValidTo(); // m_VALID_FROM = 0; // todo m_VALID_TO = 0; // todo // -------------------------------- return true; } else OTLog::Error("OTPayment::SetTempValuesFromPurse: Error: Wrong type. (Returning false.)\n"); return false; }