Added gamelib for Position functions.
This commit is contained in:
parent
0ad45d6826
commit
a7d7667491
|
@ -12,6 +12,7 @@ Module
|
||||||
dofile 'protocol'
|
dofile 'protocol'
|
||||||
dofile 'protocollogin'
|
dofile 'protocollogin'
|
||||||
dofile 'protocolgame'
|
dofile 'protocolgame'
|
||||||
|
dofile 'position'
|
||||||
dofile 'game'
|
dofile 'game'
|
||||||
|
|
||||||
dofile 'creature'
|
dofile 'creature'
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
Position = {}
|
||||||
|
|
||||||
|
function Position.equals(pos1, pos2)
|
||||||
|
return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z
|
||||||
|
end
|
||||||
|
|
||||||
|
function Position.greaterThan(pos1, pos2, orEqualTo)
|
||||||
|
if orEqualTo then
|
||||||
|
return pos1.x >= pos2.x or pos1.y >= pos2.y or pos1.z >= pos2.z
|
||||||
|
else
|
||||||
|
return pos1.x > pos2.x or pos1.y > pos2.y or pos1.z > pos2.z
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Position.lessThan(pos1, pos2, orEqualTo)
|
||||||
|
if orEqualTo then
|
||||||
|
return pos1.x <= pos2.x or pos1.y <= pos2.y or pos1.z <= pos2.z
|
||||||
|
else
|
||||||
|
return pos1.x < pos2.x or pos1.y < pos2.y or pos1.z < pos2.z
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue