Pretty sure explicitly getting a variable by using the correct method to get its correct type isn't against the nature of Python. This, in all honesty, is not up for discussion. It seems very code-lazy to me to expect to be able to use a dictionary type object to return the correct value. Simply use the given GetInt, GetFloat, GetString, etc... to get the correct value that you are looking for.
Satoon
Event system discussion
Please keep in mind that anyone will be able to add the event functionality later. Most people that code will know the types that they are looking for and cast them as such. This, I believe, is why Mattie opted to simply return everything as a string. It is easy enough to change the type in Python if needed and required far too much legwork.
The resource file does declare the types that they "should" be, so it would be relatively painless to view this and declare for yourself. That's how we did it with the whole of GunGame. Another thought is that it can be detrimental to force the declared type. What if I "want" the userid to be a string because of the way my data table is laid out? Then I str() it, right? If someone wants something other than what it is, they are free to change it.
The resource file does declare the types that they "should" be, so it would be relatively painless to view this and declare for yourself. That's how we did it with the whole of GunGame. Another thought is that it can be detrimental to force the declared type. What if I "want" the userid to be a string because of the way my data table is laid out? Then I str() it, right? If someone wants something other than what it is, they are free to change it.
Who is online
Users browsing this forum: No registered users and 62 guests