File: Games\GamesByEmail.js

GamesByEmail
Class Territories

Array
  
 
 
GamesByEmail.Territories

All Implemented Interfaces:

Class


GamesByEmail.Territories

extends Array
implements Foundation.Class

A collection of territories in a game, like Gambit. May be used directly or extended. Implemented as an Array.

See Also:

GamesByEmail.Territory

Constructor Summary
GamesByEmail.Territories(/*Game*/ game, /*Class*/ territoryClass, /*Array*/ territories)
Creates a territory collection.

Field Summary
Gamegame
The parent game object.

Fields inherited from Array
length

Method Summary
StringBuilderappendHtml(/*StringBuilder*/ htmlBuilder)
Appends the HTML necessary for the territoies. By default adds a container element, the calls the GamesByEmail.Territory.appendHtml for each territory, and then calls the appendOverlayHtml method of the collection.
StringBuilderappendOverlayHtml(/*StringBuilder*/ htmlBuilder)
Override to add HTML that shows above all the territories.
voidclearMouseEvents()
Clears all mouse events of the collection.
 dispose()
TerritoryfindAtPoint(/*Point*/ point, /*Number*/ checkThisIndexFirst)
Searches the collection to find the first territory containing the point in its polygon.
voidhideHilites()
Hides the highlight of every territory in the collection.

Methods inherited from Array
indexOf

Methods inherited from Foundation.Class
getTypePath, isInstanceOf

Constructor Detail

Territories

GamesByEmail.Territories(/*Game*/ game,
                         /*Class*/ territoryClass,
                         /*Array*/ territories)

Creates a territory collection.

Parameters:
game - 
The parent game object.
territoryClass - 
The class to use for individual territories.
territories - 
The data for the territories to inherit.

Field Detail

game

Game game

The parent game object.

Method Detail

appendHtml

StringBuilder appendHtml(/*StringBuilder*/ htmlBuilder)

Appends the HTML necessary for the territoies. By default adds a container element, the calls the GamesByEmail.Territory.appendHtml for each territory, and then calls the appendOverlayHtml method of the collection.

Parameters:
htmlBuilder - 
The builder to append the HTML for the territories.
Returns:
The string builder.
See Also:
GamesByEmail.Territory.appendHtml, appendOverlayHtml

appendOverlayHtml

StringBuilder appendOverlayHtml(/*StringBuilder*/ htmlBuilder)

Override to add HTML that shows above all the territories.

Parameters:
htmlBuilder - 
The builder to append the HTML for the territory.
Returns:
The string builder.

clearMouseEvents

void clearMouseEvents()

Clears all mouse events of the collection.

See Also:
onMouseOver, onMouseMove, onMouseOut, onMouseDown, onMouseUp, onLeftMouseDown, onLeftMouseUp, onRightMouseDown, onRightMouseUp, onMiddleMouseDown, onMiddleMouseUp

dispose

dispose()
Overrides:
dispose in class Class

findAtPoint

Territory findAtPoint(/*Point*/ point,
                      /*Number*/ checkThisIndexFirst)

Searches the collection to find the first territory containing the point in its polygon.

Parameters:
point - 
The point to check.
checkThisIndexFirst - 
(Optional) If provided, will check this index first, then check from start of collection.
Returns:
The first territory to contain the point, or null.

hideHilites

void hideHilites()

Hides the highlight of every territory in the collection.