SAIL - HexInArea

Gotowe kody SAIL'a, informacje na temat moddingu, itd.

Moderator: zoNE

Post Reply
User avatar

Topic author
zoNE
The Great Uniter & Site Administrator
The Great Uniter & Site Administrator
Posts: 1570
Joined: Fri Feb 17, 2006 3:44 pm
Location: Poland
Contact:

SAIL - HexInArea

#1

Post by zoNE » Tue Nov 03, 2015 10:15 pm

Serpent wrote:Funkcja zwraca prawdę jeśli dane koordynaty x,y należą do danej arei.

Code: Select all

Export Function HexInArea(x, y, area);
var i, tmp, list;
begin
tmp := false;
list := AreaToList(area, 0);

for i = 1 to list[1] do
    begin
    if list[1][i] = x and list[2][i] = y then
       begin
       tmp := true;
        break;
       end;
    end;

result := tmp;
End;

Notka:
Funkcja InArea(x, y, area) ma takie samo zastosowanie :)
Author: Serpent
Topic: viewtopic.php?f=42&t=4544

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest