Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » FleetIntel question
Re: FleetIntel question |
Mon, 11 July 2011 03:15 |
|
Daniel | | | Messages: 179
Registered: April 2006 Location: Nowra, Australia | |
|
Aeglos wrote on Mon, 11 July 2011 06:53 | I'm working on this, but I want to be clear on something.
Daniel wrote on Sat, 09 July 2011 20:22 | So StarReport for your homeworld is actually the same object as the Star for your homeworld, using polymorphism.
|
Does this mean that effectively OwnedStars<X> should be exactly the same as StarReports<X>? Or it was meant in a more liberal sense where OwnedStars<X> is the extended object of StarReports<X>?
Because in the first case I do not see much sense in having the OwnedStars collection if they are all duplicates of things already found in StarReports. (Same for with fleets).
|
No. OwnedStars is a subset of StarReports with a different type definition. ie
Dictionary<string,Star] OwnedStars;
Dictionary<string,StarReport] StarReports;
thus:
StarReports[x] as Star
would be equivellent to
OwnedStars[x]
There are no "duplicates" because they are all reference objects. If you change the fields of OwnedStars[x], you are also changing StarReports[x]. However you would generally be looking at different fields anyway so that is not the point.
The point is that you can itterate through EmpireData.StarReports when you only care about data you might get from stars you do not own (e.g. map drawing); and you would itterate through EmpireData.OwnedStars when you want to be garunteed that all the Stars considered are owned by the current empire, such as when selecting next/prev planet in the production view (not sure if you can even do this yet).
Have fun.Report message to a moderator
|
|
|
|
|
FleetIntel question
|
|
|
Re: FleetIntel question
By: Aeglos on Tue, 05 July 2011 22:00
|
|
|
Re: FleetIntel question
By: Daniel on Wed, 06 July 2011 18:52
|
|
|
Re: FleetIntel question
By: Aeglos on Wed, 06 July 2011 22:06
|
|
|
Re: FleetIntel question
By: Daniel on Thu, 07 July 2011 05:03
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
By: Aeglos on Wed, 06 July 2011 17:01
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
By: Aeglos on Wed, 06 July 2011 21:05
|
|
|
Re: FleetIntel question
By: Aeglos on Thu, 07 July 2011 05:40
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
By: Daniel on Sat, 09 July 2011 20:22
|
|
|
Re: FleetIntel question
By: Aeglos on Sun, 10 July 2011 16:53
|
|
|
Re: FleetIntel question
By: Daniel on Mon, 11 July 2011 03:15
|
|
|
Re: FleetIntel question
By: Aeglos on Sat, 09 July 2011 20:38
|
|
|
Re: FleetIntel question
By: Daniel on Sat, 09 July 2011 23:50
|
|
|
Re: FleetIntel question
By: Aeglos on Mon, 11 July 2011 04:11
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
By: Daniel on Mon, 11 July 2011 07:19
|
|
|
Re: FleetIntel question
By: Aeglos on Mon, 11 July 2011 14:44
|
|
|
Re: FleetIntel question
By: Aeglos on Wed, 13 July 2011 21:35
|
|
|
Re: FleetIntel question
By: Daniel on Thu, 14 July 2011 04:53
|
|
|
Re: FleetIntel question
By: Aeglos on Thu, 14 July 2011 05:11
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
By: Aeglos on Thu, 14 July 2011 17:46
|
|
|
Re: FleetIntel question
By: Aeglos on Thu, 21 July 2011 23:59
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
By: Aeglos on Fri, 22 July 2011 16:45
|
|
|
Re: FleetIntel question
|
|
|
Re: FleetIntel question
By: Daniel on Fri, 22 July 2011 17:52
|
Goto Forum:
Current Time: Sat May 04 10:15:13 EDT 2024
|