Codechange: Use iteration when dealing with all HouseSpecs.
This commit is contained in:

committed by
Michael Lutz

parent
3e83dcedfd
commit
e16b982b6a
@@ -52,6 +52,15 @@ std::vector<HouseSpec> &HouseSpec::Specs()
|
||||
return _house_specs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the index of this spec.
|
||||
* @return The index.
|
||||
*/
|
||||
HouseID HouseSpec::Index() const
|
||||
{
|
||||
return static_cast<HouseID>(this - _house_specs.data());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the spec for a house ID.
|
||||
* @param house_id The ID of the house.
|
||||
|
Reference in New Issue
Block a user