WoW:API GetMapContinents: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Recategorized)
Line 1: Line 1:
  <center>'''GetMapContinents''' ''-Documentation by [[user:Meog|Meog]]-''</center>
  <center>'''GetMapContinents''' ''-Documentation by [[user:Meog|Meog]]-''</center>


Returns the continent names
Returns a list of continent names


  GetMapContinents();
  continent_1, continent_2, ..., continent_N = GetMapContinents();


----
----
Line 13: Line 13:
;''Returns''
;''Returns''


:String continent_1, String continent_2, ..., String continent_n
:continent_1, continent_2, ..., continent_N
:;continent_i : string, holds one continent name (i is equal to the value [[API_GetCurrentMapContinent]] returns)
:;continent_<i>i</i> : String - The name of the <i>i</i>'th continent, (i corresponds to the value [[API GetCurrentMapContinent|GetCurrentMapContinent()]] returns)


----
----
;''Example''
;''Example''
  ContinentNames = {};
 
  continentNames = {};
   
   
  function LoadContinents(...)
  function LoadContinents(...)
     for i=1, arg.n, 1 do
     for i=1, arg.n, 1 do
       ContinentNames[i] = arg[i];
       continentNames[i] = arg[i];
     end
     end
  end
  end
   
   
  LoadContinents(GetMapContinents());
  LoadContinents(GetMapContinents());
Note that this can also be achieved with
continentNames = { GetMapContinents() } ;


;''Result''
;''Result''
Line 34: Line 40:


----
----
;''Description''
;''Details''


: Returns the continent names. At release this will be only two: "Kalimdor" and "Eastern Kingdoms", but when using this function keep in mind, that there maybe more sometime after release.
: At release this will be only two: "Kalimdor" and "Eastern Kingdoms", but when using this function keep in mind, that there maybe more sometime after release, and that they may get added before the existing ones.


----
----
{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API World Map Functions|GetMapContinents]]

Revision as of 19:30, 28 December 2004

GetMapContinents -Documentation by Meog-

Returns a list of continent names

continent_1, continent_2, ..., continent_N = GetMapContinents();

Arguments
none

Returns
continent_1, continent_2, ..., continent_N
continent_i
String - The name of the i'th continent, (i corresponds to the value GetCurrentMapContinent() returns)

Example
continentNames = {};

function LoadContinents(...)
   for i=1, arg.n, 1 do
      continentNames[i] = arg[i];
   end
end

LoadContinents(GetMapContinents());

Note that this can also be achieved with

continentNames = { GetMapContinents() } ;


Result
The array ContinentNames holds all available continent names:
ContinentNames[1] == "Kalimdor"
ContinentNames[2] == "Eastern Kingdoms"

Details
At release this will be only two: "Kalimdor" and "Eastern Kingdoms", but when using this function keep in mind, that there maybe more sometime after release, and that they may get added before the existing ones.

Template:WoW API