Bug reporting!

View previous topic View next topic Go down

Bug reporting!

Post  pygasos on Thu Jan 06, 2011 3:21 am

Just making the topic for later use! I am trying to catch up with the new code because you have changed a lot of it study
A lot of stuff is new to me, " yield " what is that Rolling Eyes
avatar
pygasos

Posts : 36
Join date : 2010-06-01
Age : 39
Location : Athens, Greece

View user profile

Back to top Go down

Re: Bug reporting!

Post  maximinus on Thu Jan 06, 2011 11:43 am

Yeh, basically I changed (or rather, removed) the data part of the game because the code was old and not well written. Also is was tangled up with the graphics engine, so now it's lot more separated. The yield code is a good example of that. basically, the regions in the game are stored as a python dictionary:

Code:

regions = {}
regions["greece"] = some_region_data

However, the graphics engine needs to see this as a flat list to iterate over. To do this we provide the helper routine:

Code:

def iterRegions(self):
    for i in regions.itertools():
        yield i

That lets us use the code:

Code:

for i in iterRegions():

The yield statement returns the next region every time the function is called, so the whole function becomes an iterator.

Now you might say, why don't we just say for i in regions.itertools() in the GUI engine, but doing it this way means we can re-write the data part in the future any way we like, just so long as iterRegions() works. That is, this way we don't expose the way that the data code works to the gui engine.

I hope that explained something, I know your native language isn't English!
avatar
maximinus
Admin

Posts : 143
Join date : 2010-03-21
Age : 45
Location : Harbin, China

View user profile http://sourceforge.net/projects/spqr/

Back to top Go down

Re: Bug reporting!

Post  maximinus on Mon Jan 17, 2011 1:01 pm

Yah! Sad

Here's a bug: a widget can't have both a click event and a double-click event, because the click event will always be caught first
avatar
maximinus
Admin

Posts : 143
Join date : 2010-03-21
Age : 45
Location : Harbin, China

View user profile http://sourceforge.net/projects/spqr/

Back to top Go down

Re: Bug reporting!

Post  pygasos on Mon Jan 17, 2011 7:33 pm

"Rome" button didn't refresh the gui. I fixed it just give it a look Razz
avatar
pygasos

Posts : 36
Join date : 2010-06-01
Age : 39
Location : Athens, Greece

View user profile

Back to top Go down

Re: Bug reporting!

Post  pygasos on Tue Apr 19, 2011 3:32 pm

It's sure more stable now and it seems like you corrected all the highlight issues. It feels like a game now Very Happy
The only think I couldn't understand is how moving units without making battles work?
I hope you conclude 0.3.8 soon Wink
avatar
pygasos

Posts : 36
Join date : 2010-06-01
Age : 39
Location : Athens, Greece

View user profile

Back to top Go down

Re: Bug reporting!

Post  maximinus on Tue Apr 19, 2011 4:27 pm

pygasos wrote:It's sure more stable now and it seems like you corrected all the highlight issues. It feels like a game now Very Happy
The only think I couldn't understand is how moving units without making battles work?
I hope you conclude 0.3.8 soon Wink

Yeh, I THINK I have solved the highlighting stuff, although I'm sure a few more issues will appear.

The battle code is not yet finished, so expect more code later. Actually, I've still got a lot of other things to do in real life, but I will try to commit an evening to SPQR a week, to keep moving forward. I would suggest that 0.3.8 is almost here, maybe one or more weeks?
avatar
maximinus
Admin

Posts : 143
Join date : 2010-03-21
Age : 45
Location : Harbin, China

View user profile http://sourceforge.net/projects/spqr/

Back to top Go down

Re: Bug reporting!

Post  SlyStalker on Sun Jan 13, 2013 2:46 pm

Is anyone else having a problem with the PyYAML extension?

SlyStalker

Posts : 7
Join date : 2013-01-12

View user profile

Back to top Go down

Re: Bug reporting!

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum