<?
//------------------------------------------------------------------------
//Map sizes
//------------------------------------------------------------------------

function getMapWidth() { //in territory
    return 100;
}

function getMapHeight() { //in territory
    return 100;
}

function getRegionWidth() { //in territory
    return 10;
}

function getRegionHeight() { //in territory
    return 10;
}

function getTerritoryXInRegion($id, $regionId) {
    return intval(($id-getMinTerritoryId($regionId)) / getRegionHeight());
}

function getTerritoryYInRegion($id) {
    return intval(($id-getMinTerritoryId($regionId)) % getRegionHeight());
}

function getRegionX($id) {
    return intval(($id-1) / (getMapHeight() / getRegionHeight()));
}

function getRegionY($id) {
    return ($id-1) % (getMapHeight() / getRegionHeight());
}

function getRegionId($x, $y) {
    return 1 + $x * (getMapHeight() / getRegionHeight()) + $y;
}

function getMinTerritoryId($regionId) {
    return intval(($regionId-1) * getRegionWidth() * getRegionHeight() + 1);
}

function getMaxTerritoryId($regionId) {
    return intval(($regionId) * getRegionWidth() * getRegionHeight());
}

//------------------------------------------------------------------------
//Colors
//------------------------------------------------------------------------

function getTerrainColor($type, $isNormal) {
    if ($isNormal) {
        switch($type) {
            default:
            return '"#a6d8a8"';
            break;
            
            case 1:
            return '"#a6d8a8"';
            break;
            
            case 2:
            return '"#a6cbd8"';
            break;
            
            case 3:
            return '"#492020"';
            break;
            
        }
    }
    else {
        switch($type) {
            default:
            return '"#b6c8b7"';
            break;
            
            case 1:
            return '"#b6c8b7"';
            break;
            
            case 2:
            return '"#b3c7cb"';
            break;
            
            case 3:
            return '"#a38080"';
            break;
            
        }
    }
}

function getStrokeColor1() {
    return '"#56b48d"';
}

//------------------------------------------------------------------------
//Building
//------------------------------------------------------------------------

function getBuildingsList() {
    $a = array();
    $a[] = "lab";
    $a[] = "plant";
    $a[] = "park";
    $a[] = "house";
    $a[] = "mine";
    return $a;
}

?>