Czy ktoś umiałby to przetłumaczyć na Delphi:
// Klasa ID structure (64 bits total)
class CKlasaID
{
public:
// Purpose: Constructor
CKlasaID()
{
m_Klasaid.m_comp.m_unAccountID = 0;
m_Klasaid.m_comp.m_EAccountType = k_EAccountTypeInvalid;
m_Klasaid.m_comp.m_EUniverse = k_EUniverseInvalid;
m_Klasaid.m_comp.m_unAccountInstance = 0;
}
// Purpose: Constructor
// Input : unAccountID - 32-bit account ID
// eUniverse - Universe this account belongs to
// eAccountType - Type of account
CKlasaID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
{
Set( unAccountID, eUniverse, eAccountType );
}
CKlasaID( uint64 ulKlasaID )
{
SetFromUint64( ulKlasaID );
}
// Purpose: Sets parameters for Klasa ID
// Input : unAccountID - 32-bit account ID
// eUniverse - Universe this account belongs to
// eAccountType - Type of account
void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
{
m_Klasaid.m_comp.m_unAccountID = unAccountID;
m_Klasaid.m_comp.m_EUniverse = eUniverse;
m_Klasaid.m_comp.m_EAccountType = eAccountType;
m_Klasaid.m_comp.m_unAccountInstance = 0;
}
uint64 ConvertToUint64() const
{
return m_Klasaid.m_unAll64Bits;
}
// simple accessors
void SetAccountID( uint32 unAccountID ) { m_Klasaid.m_comp.m_unAccountID = unAccountID; }
private:
// These are defined here to prevent accidental implicit conversion of a u32AccountID to a CKlasaID.
// If you get a compiler error about an ambiguous constructor/function then it may be because you're
// passing a 32-bit int to a function that takes a CKlasaID. You should explicitly create the KlasaID
// using the correct Universe and account Type/Instance values.
CKlasaID( uint32 );
CKlasaID( int32 );
// 64 bits total
union KlasaID_t
{
struct KlasaIDComponent_t
{
uint32 m_unAccountID : 32; // unique account identifier
unsigned int m_unAccountInstance : 20; // dynamic instance ID
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
EUniverse m_EUniverse : 8; // universe this account belongs to
} m_comp;
uint64 m_unAll64Bits;
} m_Klasaid;
};
dodanie znacznika <code class="cpp"> - fp