-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUMapTools.pas
62 lines (47 loc) · 1.32 KB
/
UMapTools.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
unit UMapTools;
interface
uses
UInterfaceWrapper, GrymCore_TLB, UGrymBaseTool, UGrymToolRadius;
type
TMapTools = class(TInterfaceWrapper<IMapTools>)
public
procedure AddTool(Tool: TGrymBaseTool);
procedure SetCurrentTool(Tool: TGrymBaseTool);
function GetRadiusTool: TGrymToolRadius;
procedure SetDefaultTool;
function IsCurrentTool(Tool: IToolBase): Boolean;
function FindTool(Tag: string): IToolBase;
end;
implementation
uses
ComObj;
{ TMapTools }
procedure TMapTools.AddTool(Tool: TGrymBaseTool);
begin
OleCheck(Self.GetInterface.AddTool(Tool));
end;
function TMapTools.FindTool(Tag: string): IToolBase;
begin
OleCheck(Self.GetInterface.FindTool(Tag, Result));
end;
function TMapTools.GetRadiusTool: TGrymToolRadius;
begin
Result := TGrymToolRadius.Create(Self
.FindTool('RADIUS_TOOL') as IGrymToolRadius);
end;
function TMapTools.IsCurrentTool(Tool: IToolBase): Boolean;
var
CurrentTool: IToolBase;
begin
OleCheck(Self.GetInterface.Get_CurrentTool(CurrentTool));
Result := (Tool = CurrentTool);
end;
procedure TMapTools.SetCurrentTool(Tool: TGrymBaseTool);
begin
OleCheck(Self.GetInterface._Set_CurrentTool(Tool));
end;
procedure TMapTools.SetDefaultTool;
begin
OleCheck(Self.GetInterface.SetDefaultTool);
end;
end.