Re: python class with in a class

  • From: "Tyler Littlefield" <tyler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 8 Apr 2009 23:43:59 -0600

make class soldier have default armor and weapon as properties.


Thanks,
Tyler Littlefield
Web: tysdomain.com
email: tyler@xxxxxxxxxxxxx
My programs don't have bugs, they're called randomly added features.

  ----- Original Message ----- 
  From: BlueScale 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Wednesday, April 08, 2009 9:46 PM
  Subject: python class with in a class


  Hi,
  Classes have never been my strong point.  But here's my question.  If I have 
a class soldier, and a class weapon, and a class armor, how do I combind them 
in to one character.  For example, the default weapon will be a shortsword with 
a set damage, damage type, etc.  The default armor type is leather with an ac 
of something like 2.  the class soldier sets attributes about the person like 
speed, strength, quickness, etc.  so how do I make the character class wield 
the default weapon and have the default armor?  Or, am I going about this all 
wrong?  Should weapons and armor be part of the soldier class?
  Thanks 

Other related posts: