(svn r23075) -Codechange: Add GetGRF() and GetGRFID() methods to Engine and Vehicle to simplify code.

This commit is contained in:
frosch
2011-11-01 00:23:41 +00:00
parent 72cd855978
commit acc3c75951
17 changed files with 84 additions and 64 deletions

View File

@@ -101,6 +101,18 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> {
{
return this->type == VEH_TRAIN || this->type == VEH_ROAD;
}
/**
* Retrieve the NewGRF the engine is tied to.
* This is the GRF providing the Action 3.
* @return NewGRF associated to the engine.
*/
const GRFFile *GetGRF() const
{
return this->grf_prop.grffile;
}
uint32 GetGRFID() const;
};
struct EngineIDMapping {