function Map( width , height )
{
    this.width = width;
    this.height = height;
    this.tiles = [];
    for ( var i = 0 ; i < this.width*this.height ; ++i )
    {
        this.tiles.push( EMPTY );
    }
}



Map.prototype.clear = function()
{
    for ( var i = 0 ; i < this.width*this.height ; ++i )
    {
        this.tiles[i] = EMPTY;
    }
}



Map.prototype.setObstructed = function( x , z , obstructed )
{
    if ( x < 0 ) return;
    if ( x >= this.width ) return;
    if ( z < 0 ) return;
    if ( z >= this.height ) return;

    this.tiles[z*this.width+x] = obstructed;
}



Map.prototype.isObstructed = function( x , z )
{
    if ( x < 0 ) return true;
    if ( x >= this.width ) return true;
    if ( z < 0 ) return true;
    if ( z >= this.height ) return true;

    return ( this.tiles[z*this.width+x] != EMPTY );
}