src/industry.h
branchgamebalance
changeset 9908 0fa543611bbe
parent 9907 3b068c3a1c74
child 9910 0b2aebc8283e
equal deleted inserted replaced
9907:3b068c3a1c74 9908:0fa543611bbe
    18 
    18 
    19 enum IndustryLifeType {
    19 enum IndustryLifeType {
    20 	INDUSTRYLIFE_NOT_CLOSABLE,     ///< Industry can never close
    20 	INDUSTRYLIFE_NOT_CLOSABLE,     ///< Industry can never close
    21 	INDUSTRYLIFE_PRODUCTION,       ///< Industry can close and change of production
    21 	INDUSTRYLIFE_PRODUCTION,       ///< Industry can close and change of production
    22 	INDUSTRYLIFE_CLOSABLE,         ///< Industry can only close (no production change)
    22 	INDUSTRYLIFE_CLOSABLE,         ///< Industry can only close (no production change)
       
    23 };
       
    24 
       
    25 /* Procedures that can be run to check whether an industry may
       
    26  * build at location the given to the procedure */
       
    27 enum CheckProc {
       
    28 	CHECK_NOTHING    = 0,
       
    29 	CHECK_FOREST     = 1,
       
    30 	CHECK_REFINERY   = 2,
       
    31 	CHECK_FARM       = 3,
       
    32 	CHECK_PLANTATION = 4,
       
    33 	CHECK_WATER      = 5,
       
    34 	CHECK_LUMBERMILL = 6,
       
    35 	CHECK_BUBBLEGEN  = 7,
       
    36 	CHECK_OIL_RIG    = 8,
       
    37 	CHECK_END,
    23 };
    38 };
    24 
    39 
    25 enum IndustyBehaviour {
    40 enum IndustyBehaviour {
    26 	INDUSTRYBEH_NONE                  =      0,
    41 	INDUSTRYBEH_NONE                  =      0,
    27 	INDUSTRYBEH_PLANT_FIELDS          = 1 << 0,  ///< periodically plants fileds around itself (temp and artic farms)
    42 	INDUSTRYBEH_PLANT_FIELDS          = 1 << 0,  ///< periodically plants fileds around itself (temp and artic farms)
    81  * Defines the data structure for constructing industry.
    96  * Defines the data structure for constructing industry.
    82  */
    97  */
    83 struct IndustrySpec {
    98 struct IndustrySpec {
    84 	const IndustryTileTable *const *table;///< List of the tiles composing the industry
    99 	const IndustryTileTable *const *table;///< List of the tiles composing the industry
    85 	byte num_table;                       ///< Number of elements in the table
   100 	byte num_table;                       ///< Number of elements in the table
    86 	byte cost_multiplier;                 ///< Base cost multiplier*/
   101 	byte cost_multiplier;                 ///< Base cost multiplier. Watch out for this one, << 5  VS << 8
    87 	IndustryType conflicting[3];          ///< Industries this industry cannot be close to
   102 	IndustryType conflicting[3];          ///< Industries this industry cannot be close to
    88 	byte check_proc;                      ///< Index to a procedure to check for conflicting circumstances
   103 	byte check_proc;                      ///< Index to a procedure to check for conflicting circumstances
    89 	CargoID produced_cargo[2];
   104 	CargoID produced_cargo[2];
    90 	byte production_rate[2];
   105 	byte production_rate[2];
    91 	byte minimal_cargo;                   ///< minimum amount of cargo transported to the stations
   106 	byte minimal_cargo;                   ///< minimum amount of cargo transported to the stations
    92 	                                      ///< If the waiting cargo is less than this number, no cargo is moved to it
   107 	                                      ///< If the waiting cargo is less than this number, no cargo is moved to it
    93 	CargoID accepts_cargo[3];             ///< 3 accepted cargos
   108 	CargoID accepts_cargo[3];             ///< 3 accepted cargos
    94 	IndustryLifeType life_type;           ///< This is also known as Industry production flag, in newgrf specs
   109 	IndustryLifeType life_type;           ///< This is also known as Industry production flag, in newgrf specs
    95 	byte climate_availability;            ///< Bitmask, giving landscape enums as bit position
   110 	byte climate_availability;            ///< Bitmask, giving landscape enums as bit position
    96 	IndustyBehaviour behaviour;           ///< How this industry will behave, and how others entities can use it
   111 	IndustyBehaviour behaviour;           ///< How this industry will behave, and how others entities can use it
       
   112 	byte map_colour;                      ///< colour used for the small map
    97 	StringID name;                        ///< Displayed name of the industry
   113 	StringID name;                        ///< Displayed name of the industry
    98 	StringID new_industry_text;           ///< Message appearing when the industry is built
   114 	StringID new_industry_text;           ///< Message appearing when the industry is built
    99 	StringID closure_text;                ///< Message appearing when the industry closes
   115 	StringID closure_text;                ///< Message appearing when the industry closes
   100 	StringID production_up_text;          ///< Message appearing when the industry's production is increasing
   116 	StringID production_up_text;          ///< Message appearing when the industry's production is increasing
   101 	StringID production_down_text;        ///< Message appearing when the industry's production is decreasing
   117 	StringID production_down_text;        ///< Message appearing when the industry's production is decreasing
       
   118 	byte appear_ingame[NUM_LANDSCAPE];    ///< Probability of appearance in game
       
   119 	byte appear_creation[NUM_LANDSCAPE];  ///< Probability of appearance during map creation
       
   120 	/* Newgrf stuff coming in */
       
   121 	uint16 callback_flags;                ///< Flags telling which grf callback is set
       
   122 	byte subst_id;
       
   123 	uint32 grfid;
       
   124 	byte override;
   102 };
   125 };
   103 
   126 
   104 /**
   127 /**
   105  * Defines the data structure of each indivudual tile of an industry.
   128  * Defines the data structure of each indivudual tile of an industry.
   106  */
   129  */