Page 1 of 1

Building as both a struct and a class?

Posted: Mon Apr 03, 2017 2:15 pm
by mem359
I'm missing something, and I'm hoping for advice.

C++ normally complains if you don't use unique identifiers.
In Condition.h, we have

Code: Select all

struct FO_COMMON_API Building : public ConditionBase {
while in Building.h we have

Code: Select all

class FO_COMMON_API Building : public UniverseObject {
Both of these headers are used in Building.cpp, and probably other places.
How is there not a conflict (since structs and classes are pretty much interchangeable)?
I was going to post an issue about renaming one of those Building variables (to reduce confusion), but I wanted to check if this was done by design (some overload trick I'm not thinking of).

Re: Building as both a struct and a class?

Posted: Mon Apr 03, 2017 2:56 pm
by Geoff the Medio
The Building condition is in the Condition namespace. The Building class derived from Universe is not.

Re: Building as both a struct and a class?

Posted: Mon Apr 03, 2017 3:57 pm
by mem359
Okay, I see that now. Thanks.

(Saw that it wasn't in the Building namespace, but missed the one in Condition. That is one file where indenting everything inside the namespace would have helped.)