Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » I've branched the Codebase [Merged back into trunk]
Re: I've branched the Codebase Sun, 26 June 2011 19:16 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
To be honest I was thinking of merging back soon. The big bug hunt of the initial StarIntel is already done so I know what to look for when the FleetIntel gets plugged. I'll probably merge back later today and end the branch. This way more important changes like IDs can get done now rather than later.

I wanted to get some input on data design though. Currently the StarIntel object holds Age, IntelLevel (determined by the server, and mandates how much info you get) and a Star object. The server populates the Star object form a full game star and the IntelLevel and you can access it on the GUI with StarIntel.Star. It will only have information that the server sent you, so for example colonists will be 0 for all stars you don't own.

While this works, I find it... flaky. Having a Star inside a StarIntel just feels weird. It would probably feel more robust if StarIntel extended Star and just added Age, IntelLevel and the Update method to set data according to IntelLevel.

Passing only data is not an option since a Star has a number of Properties and methods that are useful on the GUI, like GetResourceRate() and the ProductionQueue, same as Fleet like Mass mass and FreeWarpSpeed. Coding those again is redundant.

For fleets I'm contemplating a similar issue. Fleet has much less variables to set, but the property of FleetComposition which gets the Design Names and Qty, which is extremely convenient for the GUI, depends on the Fleet having proper Ships, which if passed fully to the GUI would defeat the purpose of the FleetIntel in the first place.

I also thought of adding IStar and IFleet interfaces and making Star, Fleet, StarIntel and FleetIntel all from those, sort of use the composite pattern but decided against it since it would be over complicating things.

I will go for StarIntel and FleetIntel extending Star and Fleet. It simpler for the GUI to manipulate them that way, and the data setting logic would be almost as containing them as objects.

I'm doing this on the premise that there should be just one collection for fleets and one for stars, both owned and enemies, and that only data amounts differ.

Report message to a moderator

 
Read Message
Read Message icon7.gif
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: Where y'all from
Next Topic: "Intel" class becoming obsolete.
Goto Forum:
  


Current Time: Mon Apr 29 08:27:39 EDT 2024