newgrf_generic.h File Reference

Functions related to generic callbacks. More...

#include "cargo_type.h"
#include "industry_type.h"
#include "newgrf.h"

Go to the source code of this file.

Enumerations

enum  AIConstructionEvent {
  AICE_TRAIN_CHECK_RAIL_ENGINE = 0x00, AICE_TRAIN_CHECK_ELRAIL_ENGINE = 0x01, AICE_TRAIN_CHECK_MONORAIL_ENGINE = 0x02, AICE_TRAIN_CHECK_MAGLEV_ENGINE = 0x03,
  AICE_TRAIN_GET_RAIL_WAGON = 0x08, AICE_TRAIN_GET_ELRAIL_WAGON = 0x09, AICE_TRAIN_GET_MONORAIL_WAGON = 0x0A, AICE_TRAIN_GET_MAGLEV_WAGON = 0x0B,
  AICE_TRAIN_GET_RAILTYPE = 0x0F, AICE_ROAD_CHECK_ENGINE = 0x00, AICE_ROAD_GET_FIRST_ENGINE = 0x01, AICE_ROAD_GET_NUMBER_ENGINES = 0x02,
  AICE_SHIP_CHECK_ENGINE = 0x00, AICE_SHIP_GET_FIRST_ENGINE = 0x01, AICE_SHIP_GET_NUMBER_ENGINES = 0x02, AICE_AIRCRAFT_CHECK_ENGINE = 0x00,
  AICE_STATION_GET_STATION_ID = 0x00
}
 

AI events for asking the NewGRF for information.

More...

Functions

void ResetGenericCallbacks ()
 Reset all generic feature callback sprite groups.
void AddGenericCallback (uint8 feature, const GRFFile *file, const SpriteGroup *group)
 Add a generic feature callback sprite group to the appropriate feature list.
uint16 GetAiPurchaseCallbackResult (uint8 feature, CargoID cargo_type, uint8 default_selection, IndustryType src_industry, IndustryType dst_industry, uint8 distance, AIConstructionEvent event, uint8 count, uint8 station_size, const GRFFile **file)
 'Execute' an AI purchase selection callback

Variables

static const IndustryType IT_AI_UNKNOWN = 0xFE
 The AI has no specific industry in mind.
static const IndustryType IT_AI_TOWN = 0xFF
 The AI actually wants to transport to/from a town, not an industry.

Detailed Description

Functions related to generic callbacks.

Definition in file newgrf_generic.h.


Enumeration Type Documentation

AI events for asking the NewGRF for information.

Enumerator:
AICE_TRAIN_CHECK_RAIL_ENGINE 

Check if we should build an engine.

AICE_TRAIN_CHECK_ELRAIL_ENGINE 

Check if we should build an engine.

AICE_TRAIN_CHECK_MONORAIL_ENGINE 

Check if we should build an engine.

AICE_TRAIN_CHECK_MAGLEV_ENGINE 

Check if we should build an engine.

AICE_TRAIN_GET_RAIL_WAGON 

Check if we should build an engine.

AICE_TRAIN_GET_ELRAIL_WAGON 

Check if we should build an engine.

AICE_TRAIN_GET_MONORAIL_WAGON 

Check if we should build an engine.

AICE_TRAIN_GET_MAGLEV_WAGON 

Check if we should build an engine.

AICE_TRAIN_GET_RAILTYPE 

Check if we should build a railtype.

AICE_ROAD_CHECK_ENGINE 

Check if we should build an engine.

AICE_ROAD_GET_FIRST_ENGINE 

Unused, we check all.

AICE_ROAD_GET_NUMBER_ENGINES 

Unused, we check all.

AICE_SHIP_CHECK_ENGINE 

Check if we should build an engine.

AICE_SHIP_GET_FIRST_ENGINE 

Unused, we check all.

AICE_SHIP_GET_NUMBER_ENGINES 

Unused, we check all.

AICE_AIRCRAFT_CHECK_ENGINE 

Check if we should build an engine.

AICE_STATION_GET_STATION_ID 

Get a station ID to build.

Definition at line 22 of file newgrf_generic.h.


Function Documentation

void AddGenericCallback ( uint8  feature,
const GRFFile file,
const SpriteGroup group 
)

Add a generic feature callback sprite group to the appropriate feature list.

Parameters:
feature The feature for the callback.
file The GRF of the callback.
group The sprite group of the callback.

Definition at line 53 of file newgrf_generic.cpp.

References grfmsg(), and lengthof.


Generated on Fri May 27 04:19:57 2011 for OpenTTD by  doxygen 1.6.1