Class TSerializationProcessVectorsHelper

Unit

Declaration

type TSerializationProcessVectorsHelper = class helper(TObject) for TSerializationProcess

Description

Helper methods you can use from TCastleComponent.CustomSerialization to manage reading/writing of vectors.

Hierarchy

Overview

Methods

Public procedure ReadWriteVector(const Key: String; var Value: TVector2; const DefaultValue: TVector2; const IsStored: Boolean); overload;
Public procedure ReadWriteVector(const Key: String; var Value: TVector3; const DefaultValue: TVector3; const IsStored: Boolean); overload;
Public procedure ReadWriteVector(const Key: String; var Value: TVector4; const DefaultValue: TVector4; const IsStored: Boolean); overload;

Description

Methods

Public procedure ReadWriteVector(const Key: String; var Value: TVector2; const DefaultValue: TVector2; const IsStored: Boolean); overload;

Serialize and deserialize given vector Value.

When deserializing, we always try to read it from file. If it is not present, the Value is not modified. If it is present in the file, but not all components, then the not present componens are not modified (they are not reset to DefaultValue! The DefaultValue is only used at writing).

When serializing, we write it to file only if IsStored. Generally IsStored=false should indicate "the Value is the same as when the object is created, thus there's no point in serializing it". Moreover, each vector component (Value.X, Value.Y...) is written only if it is different than corresponding DefaultValue vector component (DefaultValue.X, DefaultValue.Y...).

Public procedure ReadWriteVector(const Key: String; var Value: TVector3; const DefaultValue: TVector3; const IsStored: Boolean); overload;
 
Public procedure ReadWriteVector(const Key: String; var Value: TVector4; const DefaultValue: TVector4; const IsStored: Boolean); overload;
 

Generated by PasDoc 0.16.0.