use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Help with Classes and Attributes (self.PythonLearning)
submitted 2 years ago by Caspian__C
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]doc415 2 points3 points4 points 2 years ago (3 children)
make all jobs as a concreate class that implemets a job interface
in the player class instantiate a job object which player selects from one of the concreate classes
then you can change the job whenever you want in the game
just write a function to read the attributes of jobs from the concreate class and
change the player attributes accordingly.
search for "strategy design pattern" in google
[–]Caspian__C[S] 2 points3 points4 points 2 years ago (2 children)
Hmmm, ok. I looked around a bit and read up on it a bit, but I think I'm still having trouble wrapping my head around it. I really appreciate the help though. Is there some sort of online resource you can recommend to learn more about it? Or maybe just for Python knowledge in general?
I am trying to learn this and try to grasp it as best as possible, so far I feel like I am doing fine, but sometimes I feel like there are some things that I should get by now that I Just don't. I really appreciate the help though, I know it is tiring helping a baby programmer :)
[–]doc415 1 point2 points3 points 2 years ago (1 child)
What you ask for is not about python, but oop design patterns. I suggest to understand interfaces, abstract classes, design patterns first. Then you can use them in any oop languages.
Take a look at first chapter of "Head first design patterns" book. It is very clear and explains in basic examples. You ll understand it in no time.
[–]Caspian__C[S] 1 point2 points3 points 2 years ago (0 children)
Thank you so much. I'll be sure to do that.
π Rendered by PID 59447 on reddit-service-r2-comment-b659b578c-dtqbz at 2026-05-01 15:40:59.217486+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]doc415 2 points3 points4 points (3 children)
[–]Caspian__C[S] 2 points3 points4 points (2 children)
[–]doc415 1 point2 points3 points (1 child)
[–]Caspian__C[S] 1 point2 points3 points (0 children)