mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-24 04:34:16 +01:00
Codechange: Use EnumBitSet for IndustryBehaviours.
This commit is contained in:
committed by
Peter Nelson
parent
9d451d6350
commit
2bb3f368e3
@@ -165,14 +165,14 @@
|
||||
{
|
||||
if (!IsValidIndustry(industry_id)) return false;
|
||||
|
||||
return (::GetIndustrySpec(::Industry::Get(industry_id)->type)->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0;
|
||||
return ::GetIndustrySpec(::Industry::Get(industry_id)->type)->behaviour.Test(IndustryBehaviour::BuiltOnWater);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptIndustry::HasHeliport(IndustryID industry_id)
|
||||
{
|
||||
if (!IsValidIndustry(industry_id)) return false;
|
||||
|
||||
return (::GetIndustrySpec(::Industry::Get(industry_id)->type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
|
||||
return ::GetIndustrySpec(::Industry::Get(industry_id)->type)->behaviour.Test(IndustryBehaviour::AIAirShipRoutes);
|
||||
}
|
||||
|
||||
/* static */ TileIndex ScriptIndustry::GetHeliportLocation(IndustryID industry_id)
|
||||
@@ -194,7 +194,7 @@
|
||||
{
|
||||
if (!IsValidIndustry(industry_id)) return false;
|
||||
|
||||
return (::GetIndustrySpec(::Industry::Get(industry_id)->type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
|
||||
return ::GetIndustrySpec(::Industry::Get(industry_id)->type)->behaviour.Test(IndustryBehaviour::AIAirShipRoutes);
|
||||
}
|
||||
|
||||
/* static */ TileIndex ScriptIndustry::GetDockLocation(IndustryID industry_id)
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
if (!IsValidIndustryType(industry_type)) return false;
|
||||
|
||||
if (_settings_game.game_creation.landscape != LandscapeType::Temperate) return true;
|
||||
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_DONT_INCR_PROD) == 0;
|
||||
return !::GetIndustrySpec(industry_type)->behaviour.Test(IndustryBehaviour::DontIncrProd);
|
||||
}
|
||||
|
||||
/* static */ Money ScriptIndustryType::GetConstructionCost(IndustryType industry_type)
|
||||
@@ -141,21 +141,21 @@
|
||||
{
|
||||
if (!IsValidIndustryType(industry_type)) return false;
|
||||
|
||||
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0;
|
||||
return ::GetIndustrySpec(industry_type)->behaviour.Test(IndustryBehaviour::BuiltOnWater);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptIndustryType::HasHeliport(IndustryType industry_type)
|
||||
{
|
||||
if (!IsValidIndustryType(industry_type)) return false;
|
||||
|
||||
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
|
||||
return ::GetIndustrySpec(industry_type)->behaviour.Test(IndustryBehaviour::AIAirShipRoutes);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptIndustryType::HasDock(IndustryType industry_type)
|
||||
{
|
||||
if (!IsValidIndustryType(industry_type)) return false;
|
||||
|
||||
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
|
||||
return ::GetIndustrySpec(industry_type)->behaviour.Test(IndustryBehaviour::AIAirShipRoutes);
|
||||
}
|
||||
|
||||
/* static */ IndustryType ScriptIndustryType::ResolveNewGRFID(SQInteger grfid, SQInteger grf_local_id)
|
||||
|
||||
Reference in New Issue
Block a user