Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef NEWGRF_GENERIC_H
00013 #define NEWGRF_GENERIC_H
00014
00015 #include "industry_type.h"
00016 #include "newgrf.h"
00017 #include "tile_type.h"
00018
00019 struct SpriteGroup;
00020
00022 enum AIConstructionEvent {
00023 AICE_TRAIN_CHECK_RAIL_ENGINE = 0x00,
00024 AICE_TRAIN_CHECK_ELRAIL_ENGINE = 0x01,
00025 AICE_TRAIN_CHECK_MONORAIL_ENGINE = 0x02,
00026 AICE_TRAIN_CHECK_MAGLEV_ENGINE = 0x03,
00027 AICE_TRAIN_GET_RAIL_WAGON = 0x08,
00028 AICE_TRAIN_GET_ELRAIL_WAGON = 0x09,
00029 AICE_TRAIN_GET_MONORAIL_WAGON = 0x0A,
00030 AICE_TRAIN_GET_MAGLEV_WAGON = 0x0B,
00031 AICE_TRAIN_GET_RAILTYPE = 0x0F,
00032
00033 AICE_ROAD_CHECK_ENGINE = 0x00,
00034 AICE_ROAD_GET_FIRST_ENGINE = 0x01,
00035 AICE_ROAD_GET_NUMBER_ENGINES = 0x02,
00036
00037 AICE_SHIP_CHECK_ENGINE = 0x00,
00038 AICE_SHIP_GET_FIRST_ENGINE = 0x01,
00039 AICE_SHIP_GET_NUMBER_ENGINES = 0x02,
00040
00041 AICE_AIRCRAFT_CHECK_ENGINE = 0x00,
00042
00043 AICE_STATION_GET_STATION_ID = 0x00,
00044 };
00045
00046 static const IndustryType IT_AI_UNKNOWN = 0xFE;
00047 static const IndustryType IT_AI_TOWN = 0xFF;
00048
00049 void ResetGenericCallbacks();
00050 void AddGenericCallback(uint8 feature, const GRFFile *file, const SpriteGroup *group);
00051
00052 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);
00053
00055 static inline void AmbientSoundEffect(TileIndex tile)
00056 {
00057
00058 if (!HasGrfMiscBit(GMB_AMBIENT_SOUND_CALLBACK)) return;
00059
00060 extern void AmbientSoundEffectCallback(TileIndex tile);
00061 AmbientSoundEffectCallback(tile);
00062 }
00063
00064 #endif