-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimetadataobject.cpp
86 lines (71 loc) · 1.44 KB
/
imetadataobject.cpp
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include "imetadataobject.h"
IMetadataObject::IMetadataObject()
: pcName(NULL)
, pcType(NULL)
, pcProperties(NULL)
, cArea()
, iNameId(0)
, iTypeId(0)
{
}
IMetadataObject::~IMetadataObject()
{
}
void IMetadataObject::SetPosition(f32 x, f32 y)
{
ITransformable2D::SetPosition(x / static_cast<f32>(pScreen->GetWidth()), y / static_cast<f32>(pScreen->GetHeight()));
cArea.x = x;
cArea.y = y;
}
void IMetadataObject::SetWidth(f32 w)
{
ITransformable2D::SetWidth(w / static_cast<f32>(pScreen->GetWidth()));
cArea.width = w;
}
void IMetadataObject::SetHeight(f32 h)
{
ITransformable2D::SetHeight(h / static_cast<f32>(pScreen->GetHeight()));
cArea.height = h;
}
const Rect4f &IMetadataObject::GetBoundingBox() const
{
return cArea;
}
BOOL IMetadataObject::CheckHit(const Rect4f &area, Rect4f &overlap) const
{
return area.GetOverlappedRect(cArea, overlap);
}
void IMetadataObject::SetNameId(u32 nameId)
{
iNameId = nameId;
pcName = Str(nameId);
}
u32 IMetadataObject::GetNameId() const
{
return iNameId;
}
const char *IMetadataObject::GetName() const
{
return pcName;
}
void IMetadataObject::SetTypeId(u32 typeId)
{
iTypeId = typeId;
pcType = Str(typeId);
}
u32 IMetadataObject::GetTypeId() const
{
return iTypeId;
}
const char *IMetadataObject::GetType() const
{
return pcType;
}
void IMetadataObject::LoadProperties(u32 propId)
{
pcProperties = Str(propId);
}
const char *IMetadataObject::GetProperties() const
{
return pcProperties;
}