Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » Need to move away from using names as IDs
Re: Need to move away from using names as IDs |
Sat, 09 July 2011 04:37 |
|
Daniel | | | Messages: 179
Registered: April 2006 Location: Nowra, Australia | |
|
Aeglos wrote on Sat, 09 July 2011 18:06 | Sounds good to me; it's like the finishing touches that consolidate the system.
I assume the 2-24 reserved bits are futureproofing for flags?
|
They are so the Id could be a full uint and I could add a seperate value for owner, as this allowed me to use different types for Id and owner to catch some of the casting bugs.
Aeglos wrote on Sat, 09 July 2011 18:06 |
One thing though; last time I tried to use unsigned values (for Resources), I had a heck of an ugly time and needed a tremendous amount of casts to make it work. I asume this wouldn't be the case as Ids/Keys are fairly isolated from the rest of the code as far as setting and getting goes.
|
It is all handled inside Item. If you are casting with owner or Id (except to/from strings) you are probably doing something wrong.
Aeglos wrote on Sat, 09 July 2011 18:06 |
Also and just for the record, unisnged types seem to be non conformant with the CLS spec. We shouldn't have any issue though as we are not interoperating across languages.
|
Possibly an issue for third party tools. I tried to create a type definition for Id and owner so it would be easier to change the type in the future if required, like:
typedef owner_t ushort;
However this is not supported in C#. I would love to have the sort of type control available in ADA for this as it would save me hunting down a lot of runtime issues caused by implicit casts that should be errors, usually where an Id is used instead of a Key.
Have fun.Report message to a moderator
|
|
|
|
|
Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Fri, 24 June 2011 21:28
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Sat, 25 June 2011 07:28
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Sat, 25 June 2011 07:17
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Sat, 25 June 2011 18:35
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Sat, 25 June 2011 23:15
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Mon, 27 June 2011 05:49
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Mon, 27 June 2011 06:04
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Mon, 27 June 2011 07:09
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Tue, 28 June 2011 18:42
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Wed, 29 June 2011 02:06
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Wed, 29 June 2011 06:29
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Wed, 29 June 2011 06:54
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Wed, 29 June 2011 17:03
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Fri, 01 July 2011 07:56
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Sat, 09 July 2011 03:15
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Fri, 01 July 2011 15:15
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Sun, 03 July 2011 17:50
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Mon, 04 July 2011 03:25
|
|
|
Re: Need to move away from using names as IDs
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Wed, 06 July 2011 20:55
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Thu, 07 July 2011 00:20
|
|
|
Re: Need to move away from using names as IDs
By: Aeglos on Sat, 09 July 2011 04:06
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Sat, 09 July 2011 04:37
|
|
|
Re: Need to move away from using names as IDs
By: Daniel on Sat, 09 July 2011 07:48
|
Goto Forum:
Current Time: Thu May 02 10:42:40 EDT 2024
|