Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » Some important-ish changes.
Some important-ish changes. Sat, 05 May 2012 05:32 Go to next message
Aeglos is currently offline Aeglos

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

Messages: 142
Registered: May 2011
Location: Chile
Yet another thread!

While working on the new waypoints, I noticed and changed some things that are worth documenting.

1. Server's AllFleets collection is gone for good. It was redundant data already stored in each Empire. Instead ServerData has a new IterateFleets() method which returns an iterator to loop over all fleets from all empires thanks to LINQ. Much cleaner with no redundant data bookeeping.
(Some bugs remain with modified iterators though, tackling them now).

2. I've extended the long datatype so that operations Owner() and Id() can be directly called on Key. Before, to get both a Key and Owner you needed access to the full object (Item). Now you just need the Key and you can do Key.Owner() to get the empire id. Should simplify lots of things everywhere.

3. Cargo item is now implemented as a collection internally, so you can iterate over it's Commodities. (Was of use for the CargoDialog). I'm thinking of doing this for the Resource class too, in fact, i've been thinking of merging these two into a single thing as they often interact and contain very similar characteristics.

Improving the most base objects like this can have very nice effects on the overall code. I'll try to improve more on these kind of things in the future.

Report message to a moderator

Re: Some important-ish changes. Sat, 05 May 2012 06:31 Go to previous messageGo to next message
Daniel is currently offline Daniel

 
Chief Warrant Officer 3
Stars! Nova developer
Stars! Nova developer

Messages: 179
Registered: April 2006
Location: Nowra, Australia
I was trying to figure why ordering a cargo transfer did not get cargo into the fleet after generating a turn (rev 795). Turns out it is because the orders were applied against the EmpireData but ProcessFleet used serverState.AllFleets (which never got the cargo order). Hopefully these changes will fix that.

I also had a crash when sending a scout out in Rev 595: due to changes in UpdateFleet(). target.Owner is used when target may still be null. Not sure yet how best to work around this, as I am still understanding how target/receiver/sender work. --edit Looks like you have already tackled this.



[Updated on: Sat, 05 May 2012 06:34]




Have fun.

Report message to a moderator

Re: Some important-ish changes. Sat, 05 May 2012 14:31 Go 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
AllDesigns has also been removed, it was not even used anywhere.

Added an appropiate IterateAllDesigns() to ServerData in case it's needed.

Report message to a moderator

Previous Topic: Spam posts
Next Topic: New Waypoint System
Goto Forum:
  


Current Time: Tue Apr 16 19:41:05 EDT 2024