I want to model the jedi order from Star Wars as follows:
a novice can:
- (1) learn with books
a padawan can:
- (1) learn with books
- (2) learn with his master
a knight can:
- (3) go to war
- (4) take the test to become a master
- (5) become a master (if he passes the test)
a master can:
- (3) go to war
- (6) take a novice as a padawan (and transform the novice into padawan)
- (7) complete the training of his padawan and make him a knight (and transform the padawan into knight)
The pain point I'm going through is that at some point I would like to do this:
anakin # novice
obiwan # master
obiwan.takes_padawan(anakin)
anakin # padawan
In other words, I'd like to promote an instance of Novice class to an instance of Padawan class. I saw some solutions that only solved partially the above enumerated constraints like:
- using metaclasses (meh)
- having only one class with an attribute grade and several promote methods
H.E.L.P haha
Thank you folks :)