CAST II Game Engine

   DESCRIPTION       FEATURES       SCREENSHOTS       FORUMS       DOCUMENTATION       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TProperties

Unit

Props

Declaration

type TProperties = class

Description

Main properties class

Fields

 NameDescription
PublicChangedThis field becomes True with any change of properties or values
ProtectedFTotalPropertiesNumber of properties
ProtectedPropertiesSet of properties

Methods

Overview

Publicdestructor Destroy; override;
Publicfunction Add(const AName: string; const AValueType: Integer; const AOptions: TPOptions; const AValue, AEnumeration: string; const ADescription: string = ''): Integer;
Publicfunction AddBinary(const AName: string; const AOptions: TPOptions; AData: Pointer; DataSize: Integer): Integer;
Publicfunction AddEnumerated(const AName: string; const AOptions: TPOptions; AValue: Integer; const AEnumeration: string): Integer;
Publicprocedure AddSetProperty(const Name: string; Value, VisibleMembers: TSet32; const ValuesEnum, ADescription: string); overload;
Publicprocedure AddSetProperty(const Name: string; Value, VisibleMembers: TSet32; ValuesEnum: TStringArray; const ADescription: string); overload;
Publicprocedure Clear; virtual;
Publicprocedure DoForEach(Action: TPropertyDelegate; var CustomData: Integer);
Publicfunction Exists(const Name: string): Boolean;
Publicfunction GetAsInteger(const Name: string): Integer; virtual;
Publicfunction GetAsXML: string; virtual;
Protectedfunction GetIndex(const Name: string): Integer; virtual;
Publicfunction GetNameByIndex(const Index: Integer): string; virtual;
Publicfunction GetOptions(const Name: string): TPOptions; virtual;
Publicfunction GetProperty(const Name: string): PProperty; virtual;
Protectedfunction GetPropertyByIndex(const Index: Integer): PProperty; virtual;
Publicfunction GetType(const Name: string): Integer; virtual;
Publicfunction GetTypeAsString(Index: Integer): string; virtual;
Protectedfunction GetValue(const Name: string): string;
Protectedfunction GetValueByIndex(Index: Integer): string; virtual;
Publicfunction IsEqual(const Props: TProperties): Boolean;
Publicfunction IsEqualProperty(const Prop1, Prop2: TProperty): Boolean;
Publicprocedure Merge(const Props: TProperties; OverrideExisting: Boolean);
Publicfunction Read(Stream: TStream): Boolean; virtual;
Protectedprocedure SetEnumeratedValueByIndex(Index, ValueIndex: Integer);
Publicfunction SetSetProperty(const Name: string; var Res: TSet32; ValuesEnum: TStringArray): Boolean; overload;
Publicfunction SetSetProperty(const Name: string; var Res: TSet32; const ValuesEnum: string): Boolean; overload;
Protectedfunction SetValue(const Name, Value: string): Integer; virtual;
Protectedprocedure SetValueByIndex(Index: Integer; const Value: string);
Publicfunction Valid(const Name: string): Boolean; virtual;
Protectedfunction ValueToFloat(const Value: string): Extended; virtual;
Protectedfunction ValueToInteger(ValueType: Integer; const Value, Enumeration: string): Integer; virtual;
Publicfunction Write(Stream: TStream): Boolean; virtual;

Description

Publicdestructor Destroy; override;

 

Publicfunction Add(const AName: string; const AValueType: Integer; const AOptions: TPOptions; const AValue, AEnumeration: string; const ADescription: string = ''): Integer;

Adds a new property to the set and returns its index

Publicfunction AddBinary(const AName: string; const AOptions: TPOptions; AData: Pointer; DataSize: Integer): Integer;

Adds a new binary property to the set and returns its index

Publicfunction AddEnumerated(const AName: string; const AOptions: TPOptions; AValue: Integer; const AEnumeration: string): Integer;

Adds a new enumerated property to the set and returns its index

Publicprocedure AddSetProperty(const Name: string; Value, VisibleMembers: TSet32; const ValuesEnum, ADescription: string); overload;

Adds a variable of a set type as a set of boolean values to the current property set.
VisibleMembers is a set of members which should be added. If it's empty all members will be added.

Publicprocedure AddSetProperty(const Name: string; Value, VisibleMembers: TSet32; ValuesEnum: TStringArray; const ADescription: string); overload;

Adds a variable of a set type as a set of boolean values to the current property set.
VisibleMembers is a set of members which should be added. If it's empty all members will be added.

Publicprocedure Clear; virtual;

Clear the current property set

Publicprocedure DoForEach(Action: TPropertyDelegate; var CustomData: Integer);

Calls the Action delegate for each property

Publicfunction Exists(const Name: string): Boolean;

Returns True if a property with the specified name exists in the set

Publicfunction GetAsInteger(const Name: string): Integer; virtual;

Returns an integer representation of the properties value

Publicfunction GetAsXML: string; virtual;

Returns the properties in XML format

Protectedfunction GetIndex(const Name: string): Integer; virtual;

Returns the index of the specified property

Publicfunction GetNameByIndex(const Index: Integer): string; virtual;

Returns property name by its index

Publicfunction GetOptions(const Name: string): TPOptions; virtual;

Returns property option set

Publicfunction GetProperty(const Name: string): PProperty; virtual;

Returns a pointer to property by its name or nil if it is not found

Protectedfunction GetPropertyByIndex(const Index: Integer): PProperty; virtual;

Returns a pointer to the property data structure by property index

Publicfunction GetType(const Name: string): Integer; virtual;

Returns property value type

Publicfunction GetTypeAsString(Index: Integer): string; virtual;

Returns property value type as string

Protectedfunction GetValue(const Name: string): string;

Returns the value of the specified property

Protectedfunction GetValueByIndex(Index: Integer): string; virtual;

Returns the value of the specified by index property

Publicfunction IsEqual(const Props: TProperties): Boolean;

Returns True if both property sets are equal

Publicfunction IsEqualProperty(const Prop1, Prop2: TProperty): Boolean;

Returns True if both properties are equal

Publicprocedure Merge(const Props: TProperties; OverrideExisting: Boolean);

Adds a properties set specified by Props to the current set. If OverrideExisting existing values will be overridden by the new ones

Publicfunction Read(Stream: TStream): Boolean; virtual;

Reads the properties from a stream and return True if success

Protectedprocedure SetEnumeratedValueByIndex(Index, ValueIndex: Integer);

Sets the value index of the specified by index enumerated property

Publicfunction SetSetProperty(const Name: string; var Res: TSet32; ValuesEnum: TStringArray): Boolean; overload;

Sets a set of boolean properties added by AddSetProperty with the specified set variable

Publicfunction SetSetProperty(const Name: string; var Res: TSet32; const ValuesEnum: string): Boolean; overload;

Sets a set of boolean properties added by AddSetProperty with the specified set variable

Protectedfunction SetValue(const Name, Value: string): Integer; virtual;

Sets the value of the specified property

Protectedprocedure SetValueByIndex(Index: Integer; const Value: string);

Sets the value of the specified by index property

Publicfunction Valid(const Name: string): Boolean; virtual;

Returns True if a property with the specified name exists and has a valid value

Protectedfunction ValueToFloat(const Value: string): Extended; virtual;

Returns a floating-point representation of the value with the specified type and enumeration

Protectedfunction ValueToInteger(ValueType: Integer; const Value, Enumeration: string): Integer; virtual;

Returns an integer representation of the value with the specified type and enumeration

Publicfunction Write(Stream: TStream): Boolean; virtual;

Writes the properties to a stream and return True if success

Properties

Overview

Publicproperty TotalProperties: Integer;
Publicproperty Values[const Name: string]: string;

Description

Publicproperty TotalProperties: Integer;

 

Publicproperty Values[const Name: string]: string;

Property values by names

Last modified: 4 Jul, 2008
Copyright (C) 2006-2008, casteng.com