SAIL - GetBuildingsList

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: 1547
Joined: Fri Feb 17, 2006 3:44 pm
Location: Poland
Contact:

SAIL - GetBuildingsList

#1

Post by zoNE » Wed Nov 11, 2015 9:10 am

Serpent wrote:Funkcja pobiera [typ, koordynaty, kierunek] danego typu (btype) dla strony (side).
Dla argumentu btype = -1 funkcja zwraca listę ze wszystkimi budynkami danej strony.

Code: Select all

Export Function GetBuildingsList(side, btype);
var i, tmp, list;
begin
if btype = -1 then
   tmp := FilterAllUnits([[f_side, side], [f_type, unit_building]])
    else
     tmp := FilterAllUnits([[f_side, side], [f_btype, btype]]);

    list := [];

    for i = 1 to tmp do
        list := list ^ [[GetBType(tmp[i]), GetX(tmp[i]), GetY(tmp[i]), GetDir(tmp[i])]];

    result = list;
End;
Author: Serpent
Topic: viewtopic.php?f=42&t=4563

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest