2,733
edits
Red Leader (talk | contribs) (→PositionedSearch: some more, but still WIP) |
|||
Line 295: | Line 295: | ||
|param4text = Optional <code>'''me'''</code> reference. This will be used as the <code>'''me'''</code> reference in each of the above fucntions. | |param4text = Optional <code>'''me'''</code> reference. This will be used as the <code>'''me'''</code> reference in each of the above fucntions. | ||
|example1 = var searchCmd = func(){ | |example1 = var searchCmd = func(){ | ||
return | return positioned.findAirportsWithinRange(2); | ||
}; | }; | ||
var added = func( | var added = func(apt){ | ||
print(" | print("Airport ", apt.id, " added"); | ||
} | } | ||
var removed = func( | var removed = func(apt){ | ||
print(" | print("Airport ", apt.id, " removed"); | ||
} | } | ||
Line 323: | Line 323: | ||
|param1 = searchCmd | |param1 = searchCmd | ||
|param1text = Optional search function to use instead of the one given in <code>[[#new()_2|PositionedSearch.new()]]</code>. | |param1text = Optional search function to use instead of the one given in <code>[[#new()_2|PositionedSearch.new()]]</code>. | ||
|example1 = | |example1 = var searchCmd = func(){ | ||
return positioned.findAirportsWithinRange(2); | |||
}; | |||
var added = func(apt){ | |||
print("Airport ", apt.id, " added"); | |||
} | |||
var removed = func(apt){ | |||
print("Airport ", apt.id, " removed"); | |||
} | |||
var searcher = geo.PositionedSearch.new(searchCmd, added, removed); | |||
searcher.update(); | |||
}} | }} | ||
==== _equals ==== | ==== _equals ==== | ||
{{Nasal doc | |||
|syntax = geo.PositionedSearch._equals; | |||
|text = Checks if two objects are equal. You must redefine this function to use <code>geo.PositionedSearch</code> for other uses. | |||
|param1 = searchCmd | |||
|param1text = Optional search function to use instead of the one given in <code>[[#new()_2|PositionedSearch.new()]]</code>. | |||
|example1 = var searchCmd = func(){ | |||
return positioned.findAirportsWithinRange(2); | |||
}; | |||
var added = func(apt){ | |||
print("Airport ", apt.id, " added"); | |||
} | |||
var removed = func(apt){ | |||
print("Airport ", apt.id, " removed"); | |||
} | |||
var searcher = geo.PositionedSearch.new(searchCmd, added, removed); | |||
searcher.update(); | |||
}} | |||
== Functions == | == Functions == |