Applications Google
Menu principal

Post a Comment On: Only Python

"Subclassing my own classes"

2 Comments -

1 – 2 of 2
Anonymous Anonymous said...

I know that this is an old post, but hey, isn't Google great?

What you've proposed with creating a subclass to contain the visual elements of the parent is not a good idea, but since this post is 4 years old, you probably already know that by now.

6:47 PM

Blogger André Roberge said...

Google is great indeed! :-)

Actually, the design I eventually settled for was having a class for the robot "brain", and used that as a subclass for the more complete robot (with visual information such as which image to use when it was in a given orientation). In effect, it's the reverse of what I described in the post. I used that and it worked very well - plus it turned out to be very readable (I think!) I haven't touched that part of the code in about 4 years though. You can view it if you download rurple (it's in robot_factory.py).

:-)

7:27 PM

Spammers: none shall pass.
You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot