Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » FleetIntel question
Re: FleetIntel question Mon, 11 July 2011 04:11 Go to previous messageGo to previous message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
I was clear on the references and when to use the collections. My confusion arose from thinking that they would both be Dictionary<string, StarReport> types, since the plan is for a Star to extend StarReport. It would mean that a owned Star X could have been used in both collections at the same time with no casting, since they both can accept the base class by polymorphism. (That's what I meant by "duplicates": using the exact same object in both collections instead of just the base in one of them)

Quote:

No. OwnedStars is a subset of StarReports with a different type definition. ie
Dictionary<string,Star> OwnedStars;
Dictionary<string,StarReport> StarReports;



This clears up what the intent is and my confusion. Although StarReports can still accept Star objects directly. (That's what kludged me Hit over head)

Quote:

StarReports[x] as Star

would be equivellent to
OwnedStars[x]



I assume you meant OwnedStars[x] as StarReport equals StarReports[x]? Unless the 'as' operator can upcast types, since StarReport should be the new base and Star the inherited type.

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bugs/Other Trackers
Next Topic: Anyone still around?
Goto Forum:
  


Current Time: Sat May 04 14:09:18 EDT 2024