📄 untype.h
字号:
/*=============================================================================
UnType.h: Unreal engine base type definitions.
Copyright 1997-1999 Epic Games, Inc. All Rights Reserved.
=============================================================================*/
/*-----------------------------------------------------------------------------
UProperty.
-----------------------------------------------------------------------------*/
//
// An UnrealScript variable.
//
class CORE_API UProperty : public UField
{
DECLARE_ABSTRACT_CLASS(UProperty,UField,0)
DECLARE_WITHIN(UField)
// Persistent variables.
INT ArrayDim;
INT ElementSize;
DWORD PropertyFlags;
FName Category;
_WORD RepOffset;
// In memory variables.
INT Offset;
UProperty* ConstructorLinkNext;
// Constructors.
UProperty();
UProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags );
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
virtual void Link( FArchive& Ar, UProperty* Prev );
virtual UBOOL Identical( const void* A, const void* B ) const=0;
virtual void ExportCpp( FOutputDevice& Out, UBOOL IsLocal, UBOOL IsParm ) const;
virtual void ExportCppItem( FOutputDevice& Out ) const=0;
virtual void SerializeItem( FArchive& Ar, void* Value ) const=0;
virtual void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const=0;
virtual const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const=0;
virtual UBOOL ExportText( INT ArrayElement, TCHAR* ValueStr, BYTE* Data, BYTE* Delta, UBOOL HumanReadable ) const;
virtual void CopySingleValue( void* Dest, void* Src ) const;
virtual void DestroyValue( void* Dest ) const;
virtual UBOOL Port() const;
virtual BYTE GetID() const;
// Inlines.
void CopyCompleteValue( void* Dest, void* Src ) const
{
guardSlow(UProperty::CopyCompleteValue);
for( INT i=0; i<ArrayDim; i++ )
CopySingleValue( (BYTE*)Dest+i*ElementSize, (BYTE*)Src+i*ElementSize );
unguardobjSlow;
}
UBOOL Matches( const void* A, const void* B, INT ArrayIndex ) const
{
guardSlow(UProperty::Matches);
INT Ofs = Offset + ArrayIndex * ElementSize;
return Identical( (BYTE*)A + Ofs, B ? (BYTE*)B + Ofs : NULL );
unguardobjSlow;
}
INT GetSize() const
{
guardSlow(UProperty::GetSize);
return ArrayDim * ElementSize;
unguardobjSlow;
}
UBOOL ShouldSerializeValue( FArchive& Ar ) const
{
guardSlow(UProperty::ShouldSerializeValue);
UBOOL Skip
= ((PropertyFlags & CPF_Native ) )
|| ((PropertyFlags & CPF_Transient) && Ar.IsPersistent() );
return !Skip;
unguardobjSlow;
}
};
/*-----------------------------------------------------------------------------
UByteProperty.
-----------------------------------------------------------------------------*/
//
// Describes an unsigned byte value or 255-value enumeration variable.
//
class CORE_API UByteProperty : public UProperty
{
DECLARE_CLASS(UByteProperty,UProperty,0)
// Variables.
UEnum* Enum;
// Constructors.
UByteProperty()
{}
UByteProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags, UEnum* InEnum=NULL )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
, Enum( InEnum )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
};
/*-----------------------------------------------------------------------------
UIntProperty.
-----------------------------------------------------------------------------*/
//
// Describes a 32-bit signed integer variable.
//
class CORE_API UIntProperty : public UProperty
{
DECLARE_CLASS(UIntProperty,UProperty,0)
// Constructors.
UIntProperty()
{}
UIntProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
{}
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
};
/*-----------------------------------------------------------------------------
UBoolProperty.
-----------------------------------------------------------------------------*/
//
// Describes a single bit flag variable residing in a 32-bit unsigned double word.
//
class CORE_API UBoolProperty : public UProperty
{
DECLARE_CLASS(UBoolProperty,UProperty,0)
// Variables.
BITFIELD BitMask;
// Constructors.
UBoolProperty()
{}
UBoolProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
, BitMask( 1 )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
};
/*-----------------------------------------------------------------------------
UFloatProperty.
-----------------------------------------------------------------------------*/
//
// Describes an IEEE 32-bit floating point variable.
//
class CORE_API UFloatProperty : public UProperty
{
DECLARE_CLASS(UFloatProperty,UProperty,0)
// Constructors.
UFloatProperty()
{}
UFloatProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
{}
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
};
/*-----------------------------------------------------------------------------
UObjectProperty.
-----------------------------------------------------------------------------*/
//
// Describes a reference variable to another object which may be nil.
//
class CORE_API UObjectProperty : public UProperty
{
DECLARE_CLASS(UObjectProperty,UProperty,0)
// Variables.
class UClass* PropertyClass;
UObjectProperty* NextReference;
// Constructors.
UObjectProperty()
{}
UObjectProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags, UClass* InClass )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
, PropertyClass( InClass )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
};
/*-----------------------------------------------------------------------------
UObjectProperty.
-----------------------------------------------------------------------------*/
//
// Describes a reference variable to another object which may be nil.
//
class CORE_API UClassProperty : public UObjectProperty
{
DECLARE_CLASS(UClassProperty,UObjectProperty,0)
// Variables.
class UClass* MetaClass;
// Constructors.
UClassProperty()
{}
UClassProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags, UClass* InMetaClass )
: UObjectProperty( EC_CppProperty, InOffset, InCategory, InFlags, UClass::StaticClass() )
, MetaClass( InMetaClass )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
BYTE GetID() const
{
return NAME_ObjectProperty;
}
};
/*-----------------------------------------------------------------------------
UNameProperty.
-----------------------------------------------------------------------------*/
//
// Describes a name variable pointing into the global name table.
//
class CORE_API UNameProperty : public UProperty
{
DECLARE_CLASS(UNameProperty,UProperty,0)
// Constructors.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -