Add: [Script] Optional filter parameter to more ScriptXXXList constructors (#11698)
This commit is contained in:
@@ -13,23 +13,21 @@
|
||||
|
||||
#include "../../safeguards.h"
|
||||
|
||||
ScriptIndustryList::ScriptIndustryList()
|
||||
ScriptIndustryList::ScriptIndustryList(HSQUIRRELVM vm)
|
||||
{
|
||||
for (const Industry *i : Industry::Iterate()) {
|
||||
this->AddItem(i->index);
|
||||
}
|
||||
ScriptList::FillList<Industry>(vm, this);
|
||||
}
|
||||
|
||||
ScriptIndustryList_CargoAccepting::ScriptIndustryList_CargoAccepting(CargoID cargo_id)
|
||||
{
|
||||
for (const Industry *i : Industry::Iterate()) {
|
||||
if (i->IsCargoAccepted(cargo_id)) this->AddItem(i->index);
|
||||
}
|
||||
ScriptList::FillList<Industry>(this,
|
||||
[cargo_id](const Industry *i) { return i->IsCargoAccepted(cargo_id); }
|
||||
);
|
||||
}
|
||||
|
||||
ScriptIndustryList_CargoProducing::ScriptIndustryList_CargoProducing(CargoID cargo_id)
|
||||
{
|
||||
for (const Industry *i : Industry::Iterate()) {
|
||||
if (i->IsCargoProduced(cargo_id)) this->AddItem(i->index);
|
||||
}
|
||||
ScriptList::FillList<Industry>(this,
|
||||
[cargo_id](const Industry *i) { return i->IsCargoProduced(cargo_id); }
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user