load, save, store and access a WarGear map The map state is represented internally by an XML DOM.
Adds borders based upon names or territory IDs. Arguments correspond to attributes of the new border element.
Note
a “borders” element is created if it does not already exist
Warning
If your territory names are integers, they will get treated as tid attributes, so don’t do this!!
Adds a continent. Arguments correspond to attributes of the new continent element.
Note
a “continents” element is created if it does not already exist
Adds a continent. Arguments correspond to attributes of the new continent element.
Note
a “continents” element is created if it does not already exist
Adds a territory. Arguments correspond to attributes of the new territory element.
Note
a “territories” element is created if it does not already exist
Test if the specified territory can reach all other territories.
Args: territoryID (int): The territory ID for testing. If no territory ID is given, the first territory in the DOM is used.
Add a <board> element to the DOM.
note: all arguments are strings note: some problems? Better to create a new board on wargear.net, export the XML, and use loadMapFromFile()
Delete a territory.
Warning
direction is currently ignored
Note
In the case of a tie, one of the winners will be returned arbitrarily
Find the smallest continent that territoryName is a member of.
Note
In the case of a tie, one of the winners will be returned arbitrarily
Warning
direction is currently ignored
Given territoryID return all IDs of all other territories that share a border with it.
Warning
direction is not working(?)
Get a list of the IDs of the neighbors of a territory that match the neigborRegex.
Given territoryID return all IDs of all other territories that share a border with it.
Warning
direction is currently ignored
Get a collection of borders for this territory. Args:
Identifier: can be a Name or territory ID
Get the territory Element based upon a name or territory ID. Args:
Identifier: can be a Name or territory ID
Given a territory name find the ID for that territory (or None if not found) Args:
territoryName (str): The name to look for.
Given a territory ID find the name for that territory (or None if not found)
Add continents in a “hordes” style. For all territories that match baseRegex, a continent is created whose members are the original territory and all of the neighbors who match neighborRegex.
Loads the state of a map from an XML document.
Args: filePath (str):
Save the XML.
>>> saveMapToFile(//SERVER/path/to/map/MapName.xml)