Planet ownership

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
mr_ed
Space Squid
Posts: 82
Joined: Thu Jun 26, 2003 1:13 pm
Location: Ottawa

Planet ownership

#1 Post by mr_ed »

Would anybody mind adding an owner member to planets?
Or, alternatively, does anyone mind if I add an owner (empire_id) to a planet?

Otherwise, for me to find out which planet owns it (to add the missile defense value to that particular empire's fleet), I need to iterate through each empire, and iterate through each planet of that empire, until I get one that matches the planet ID.
Or is there a simpler way of doing that and I'm just missing it?

jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

#2 Post by jbarcz1 »

Isn't there an 'owner' member somewhere in planet's inheritance tree? Have you looked in the base classes? It seems odd that something as obviously useful as that would have slipped by.
Empire Team Lead

OceanMachine
Pupating Mass
Posts: 95
Joined: Thu Jun 26, 2003 12:09 pm
Location: Chicago

#3 Post by OceanMachine »

jbarcz1 wrote:Isn't there an 'owner' member somewhere in planet's inheritance tree? Have you looked in the base classes? It seems odd that something as obviously useful as that would have slipped by.
Yeah, it's inheritted from UniverseObject..
Programming Lead

mr_ed
Space Squid
Posts: 82
Joined: Thu Jun 26, 2003 1:13 pm
Location: Ottawa

#4 Post by mr_ed »

(sigh)

Yeah, I see it. :x

(kicks self)

Remember that inheritance, people.

(kicks self again)

Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#5 Post by Tyreth »

mr_ed wrote:(sigh)

Yeah, I see it. :x

(kicks self)

Remember that inheritance, people.

(kicks self again)
A horse kicking itself, how amusing 8)

Post Reply