I'm having a hard time finding where Meter class's ctor is called, either my eyes are blind and it's just in front of me or my grepping is failing me somehow. Can someone clue me in where to look at ? Thanks in advance.
I guess I'll have a d'oh moment when I read your answers.
Meter class usage
Moderator: Committer
Meter class usage
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Meter class usage
In UniverseObject.cpp:
See also UniverseObject.h:
Code: Select all
void UniverseObject::AddMeter(MeterType meter_type) {
if (INVALID_METER_TYPE == meter_type)
Logger().errorStream() << "UniverseObject::AddMeter asked to add invalid meter type!";
else
m_meters[meter_type]; // <====== here
}
Code: Select all
std::map<MeterType, Meter> m_meters;
Re: Meter class usage
I've seen that but there's some magic^WC++ in there that I don't know how to interpret... I was asking about Meter and all I see here is MeterType. Is the map automatically instantiating new objects ?Geoff the Medio wrote:In UniverseObject.cpp & See also UniverseObject.h
[thinking more & staring at the quoted code]
D'oh, I think I understand now, I was thinking that map would put NULL pointers, when nothing is specified for the bucket, but we have Meter and not Meter*, ouch, looks like I'm showing my C++ ignorance here.
Thanks for the help
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!