Class TCastleObjectList
Unit
Declaration
type TCastleObjectList = class(TObjectList)
Description
Extended TObjectList for Castle Game Engine.
Hierarchy
- TObject
- TList
- TObjectList
- TCastleObjectList
Overview
Methods
constructor CreateFromArray(const FreeObjects: boolean; const AItems: array of TObject); |
|
procedure AddRange(const A: array of TObject); overload; |
|
procedure AddArray(const A: array of TObject); deprecated 'use AddRange, consistent with other lists'; |
|
procedure AddRange(AList: Contnrs.TObjectList); overload; |
|
procedure AddList(AList: Contnrs.TObjectList); deprecated 'use AddRange, consistent with other lists'; |
|
function MakeSingle(ReplaceClass: TClass; NewItem: TObject; AddEnd: boolean): TObject; |
|
function Extract(Index: Integer): TObject; overload; |
|
function Extract(RemoveClass: TClass): TObject; overload; |
|
function RemoveAll(Item: TObject): Cardinal; |
|
function IsFirst(Value: TObject): boolean; |
|
function IsLast(Value: TObject): boolean; |
|
procedure InsertIfNotExists(Index: Integer; Value: TObject); |
|
procedure AddIfNotExists(Value: TObject); |
Description
Methods
procedure AddRange(const A: array of TObject); overload; |
|
Add contents of given array to the list. |
procedure AddArray(const A: array of TObject); deprecated 'use AddRange, consistent with other lists'; |
|
Warning: this symbol is deprecated: use AddRange, consistent with other lists |
procedure AddRange(AList: Contnrs.TObjectList); overload; |
|
Add contents of other TObjectList instance to the list. |
procedure AddList(AList: Contnrs.TObjectList); deprecated 'use AddRange, consistent with other lists'; |
|
Warning: this symbol is deprecated: use AddRange, consistent with other lists |
function MakeSingle(ReplaceClass: TClass; NewItem: TObject; AddEnd: boolean): TObject; |
|
Replace first found descendant of ReplaceClass with NewItem. In case no descendant of ReplaceClass was found, we'll we add NewItem to the list (depending on AddEnd value: at the beginning or at the end of the list). If NewItem is Returns the replaced (or removed) old item. It is removed from the list just like the Extract method, so it's never freed. Or The typical use scenario for this method is when NewItem is also a descendant from ReplaceClass, and you always keep at most one ReplaceClass descendant on the list. For example, you have UI controls list (like TCastleWindow.Controls), and you want your NewItem to be the only instance of TCastleOnScreenMenu class inside. Moreover, in case order on the list is important (for example on TCastleWindow.Controls order corresponds to screen depth — what control is under / above each other), you want to place NewItem at the same position as previous TCastleOnScreenMenu instance, if any. |
function Extract(Index: Integer): TObject; overload; |
|
Extract (remove from the list, but never free) given item index. This is similar TObjectList.Extract, except it takes an index. |
function IsFirst(Value: TObject): boolean; |
|
function IsLast(Value: TObject): boolean; |
|
procedure InsertIfNotExists(Index: Integer; Value: TObject); |
|
procedure AddIfNotExists(Value: TObject); |
|
Generated by PasDoc 0.16.0.