home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
OpList.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-05-29
|
1KB
|
49 lines
unit OpList;
interface
uses
ObjOp,ObjList;
type TOpList=class
protected
fList:TObjList;
public
constructor Create;
destructor Destroy;override;
procedure Register(OpCode:integer;OpClass:TObjOpClass);
function Find(OpCode:integer):TObjOp;
end;
implementation
constructor TOpList.Create;
begin
Inherited Create;
fList:=TObjList.Create;
end;
destructor TOpList.Destroy;
begin
fList.Free;
Inherited Destroy;
end;
procedure TOpList.Register;
Var Op:TObjOp;
begin
Op:=OpClass.Create;
Op.OpCode:=OpCode;
fList.Add(Op);
end;
function TOpList.Find;
Var i:Integer;
begin
Result:=nil;
for i:=0 to fList.Count-1 do
begin
if (fList.Obj[i] as TObjOp).OpCode=OpCode then
begin
Result:=fList.Obj[i] as TObjOp;
exit;
end;
end;
end;
end.