Source for file RecAnalystConfig.php

Documentation is available at RecAnalystConfig.php

  1. <?php
  2. /**
  3.  * Defines RecAnalystConfig class.
  4.  *
  5.  * @package recAnalyst
  6.  * @version $Id: RecAnalystConfig.php 20 2009-05-11 12:48:30Z biegleux $
  7.  * @author biegleux <biegleux[at]gmail[dot]com>
  8.  * @copyright copyright (c) 2008-2009 biegleux
  9.  * @license http://www.opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
  10.  * @link http://recanalyst.sourceforge.net/
  11.  * @filesource
  12.  */
  13.  
  14. /**
  15.  * Class RecAnalystConfig.
  16.  *
  17.  * Configuration singleton class.
  18.  * RecAnalystConfig implements configuration constants used for RecAnalyst.
  19.  *
  20.  * @package recAnalyst
  21.  */
  22. {
  23.     /**
  24.      * Instance holder of this class.
  25.      *
  26.      * @var RecAnalystConfig 
  27.      * @static
  28.      */
  29.     private static $instance null;
  30.  
  31.     /**
  32.      * Defines a path (absolute or relative) to directory where we wish to save generated maps.
  33.      * Write permission is required.
  34.      *
  35.      * @var string 
  36.      */
  37.     public $mapsDir;
  38.  
  39.     /**
  40.      * Defines a path (absolute or relative) to directory where we wish to save generated research timelines.
  41.      * Write permission is required.
  42.      *
  43.      * @var string 
  44.      */
  45.     public $researchesDir;
  46.  
  47.     /**
  48.      * Defines a path (absolute or relative) to directory where we store resources required for generating research timelines.
  49.      *
  50.      * @var string 
  51.      */
  52.     public $resourcesDir;
  53.  
  54.     /**
  55.      * Defines a width of the map image we wish to generate.
  56.      *
  57.      * @var int 
  58.      */
  59.     public $mapWidth;
  60.  
  61.     /**
  62.      * Defines a height of the map image we wish to generate.
  63.      *
  64.      * @var int 
  65.      */
  66.     public $mapHeight;
  67.  
  68.     /* following two configuration constants are applied for research timelines image */
  69.  
  70.     /**
  71.      * Defines width and height of one research tile in research timelines image.
  72.      *
  73.      * @var int 
  74.      */
  75.     public $researchTileSize;
  76.  
  77.     /**
  78.      * Defines vertical spacing between players in research timelines image.
  79.      *
  80.      * @var int 
  81.      */
  82.     public $researchVSpacing;
  83.  
  84.     /**
  85.      * Defines background image for research timelines image.
  86.      *
  87.      * @var string 
  88.      */
  89.     public $researchBackgroundImage;
  90.  
  91.     /**
  92.      * Defines color for Dark Age in the research timelines image.
  93.      * Array consist of red, green, blue color and alpha.
  94.      *
  95.      * @var array 
  96.      */
  97.     public $researchDAColor;
  98.  
  99.     /**
  100.      * Defines color for Dark Age in the research timelines image.
  101.      *
  102.      * @var array 
  103.      * @see $researchDAColor
  104.      */
  105.     public $researchFAColor;
  106.  
  107.     /**
  108.      * Defines color for Dark Age in the research timelines image.
  109.      *
  110.      * @var array 
  111.      * @see $researchDAColor
  112.      */
  113.     public $researchCAColor;
  114.  
  115.     /**
  116.      * Defines color for Dark Age in the research timelines image.
  117.      *
  118.      * @var array 
  119.      * @see $researchDAColor
  120.      */
  121.     public $researchIAColor;
  122.  
  123.     /**
  124.      * Determines if to show players positions on the map.
  125.      *
  126.      * @var bool true if it is desirable to show players positions, false otherwise
  127.      */
  128.     public $showPositions;
  129.  
  130.     /**
  131.      * Determines if to use snow colors for terrain instead of game's default ones.
  132.      *
  133.      * @var bool true if it is desirable to use snow colors, false otherwise
  134.      */
  135.     public $useSnowColors;
  136.  
  137.     /**
  138.      * Private class constructor.
  139.      *
  140.      */
  141.     private function __construct ()
  142.     {
  143.         $this->mapsDir = '/www/htdocs/.../';
  144.         $this->researchesDir = '/www/htdocs/.../';
  145.         $this->resourcesDir = '/www/htdocs/.../';
  146.         $this->mapWidth = 204;
  147.         $this->mapHeight = 102;
  148.         $this->researchTileSize = 19;
  149.         $this->researchVSpacing = 8;
  150.         $this->researchBackgroundImage = $this->resourcesDir . 'researches' DIRECTORY_SEPARATOR 'background.jpg';
  151.         $this->researchDAColor = array (0xff0x000x000x50);
  152.         $this->researchFAColor = array (0x000xff0x000x50);
  153.         $this->researchCAColor = array (0x000x000xff0x50);
  154.         $this->researchIAColor = array (0x990x660x000x50);
  155.         $this->showPositions = true;
  156.         $this->useSnowColors = true;
  157.     }
  158.  
  159.     /**
  160.      * Disallow cloning.
  161.      *
  162.      */
  163.     private function __clone ()
  164.     {
  165.     }
  166.  
  167.     /**
  168.      * Retrieves the singleton instance of this class.
  169.      *
  170.      * @return RecAnalystConfig A RecAnalystConfig implementation instance.
  171.      */
  172.     public static function getInstance ()
  173.     {
  174.         if (!isset (self::$instance))
  175.         {
  176.             self::$instance new self ();
  177.         }
  178.  
  179.         return self::$instance;
  180.     }
  181. }
  182. ?>

Documentation generated on Mon, 11 May 2009 16:43:51 +0200 by phpDocumentor 1.4.1