Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.88 KB | None | 0 0
  1. BodyPart bodyPlan;
  2.  
  3.     void initBody() {
  4.         //to anybody reading this code,
  5.         //
  6.         //I apologize.
  7.  
  8.         bodyPlan.initAsChest(); //set it as the chest
  9.        
  10.         //head
  11.         bodyPlan.childParts["head"] = {};   //add a head
  12.         bodyPlan.childParts["head"].initAsHead();   //set it to actually be a head
  13.         bodyPlan.childParts["head"].parentPart = &bodyPlan; //link it to the body plan (chest)
  14.         //left arm
  15.         bodyPlan.childParts["larm"] = {};
  16.         bodyPlan.childParts["larm"].initAsUpperArm();
  17.         bodyPlan.childParts["larm"].name = "upper left arm";
  18.         bodyPlan.childParts["larm"].parentPart = &bodyPlan;
  19.             bodyPlan.childParts["larm"].childParts["forearm"] = {}; //into the rabbit hole we go!
  20.             bodyPlan.childParts["larm"].childParts["forearm"].initAsLowerArm();
  21.             bodyPlan.childParts["larm"].childParts["forearm"].name = "left forearm";
  22.             bodyPlan.childParts["larm"].childParts["forearm"].parentPart = &bodyPlan.childParts["larm"];
  23.                 bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"] = {};
  24.                 bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"].initAsHand();
  25.                 bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"].name = "left hand";
  26.                 bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"].parentPart = &bodyPlan.childParts["larm"].childParts["forearm"];
  27.         //right arm
  28.         bodyPlan.childParts["rarm"] = {};
  29.         bodyPlan.childParts["rarm"].initAsUpperArm();
  30.         bodyPlan.childParts["rarm"].name = "upper right arm";
  31.         bodyPlan.childParts["rarm"].parentPart = &bodyPlan;
  32.             bodyPlan.childParts["rarm"].childParts["forearm"] = {}; //into the rabbit hole we go!
  33.             bodyPlan.childParts["rarm"].childParts["forearm"].initAsLowerArm();
  34.             bodyPlan.childParts["rarm"].childParts["forearm"].name = "right forearm";
  35.             bodyPlan.childParts["rarm"].childParts["forearm"].parentPart = &bodyPlan.childParts["rarm"];
  36.                 bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"] = {};
  37.                 bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"].initAsHand();
  38.                 bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"].name = "right hand";
  39.                 bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"].parentPart = &bodyPlan.childParts["rarm"].childParts["forearm"];
  40.  
  41.         //lower body
  42.         bodyPlan.childParts["abdomen"] = {};
  43.         bodyPlan.childParts["abdomen"].initAsAbdomen();
  44.         bodyPlan.childParts["abdomen"].parentPart = &bodyPlan;
  45.             //left leg
  46.             bodyPlan.childParts["abdomen"].childParts["lleg"] = {};
  47.             bodyPlan.childParts["abdomen"].childParts["lleg"].initAsUpperLeg();
  48.             bodyPlan.childParts["abdomen"].childParts["lleg"].name = "upper left leg";
  49.             bodyPlan.childParts["abdomen"].childParts["lleg"].parentPart = &bodyPlan.childParts["abdomen"];
  50.                 bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"] = {};
  51.                 bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].initAsLowerLeg();
  52.                 bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].name = "lower left leg";
  53.                 bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].parentPart = &bodyPlan.childParts["abdomen"].childParts["lleg"];
  54.                     bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"] = {};
  55.                     bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"].initAsFoot();
  56.                     bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"].name = "left foot";
  57.                     bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"].parentPart = &bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"];
  58.             //right leg
  59.             bodyPlan.childParts["abdomen"].childParts["rleg"] = {};
  60.             bodyPlan.childParts["abdomen"].childParts["rleg"].initAsUpperLeg();
  61.             bodyPlan.childParts["abdomen"].childParts["rleg"].name = "upper right leg";
  62.             bodyPlan.childParts["abdomen"].childParts["rleg"].parentPart = &bodyPlan.childParts["abdomen"];
  63.                 bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"] = {};
  64.                 bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].initAsLowerLeg();
  65.                 bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].name = "lower right leg";
  66.                 bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].parentPart = &bodyPlan.childParts["abdomen"].childParts["rleg"];
  67.                     bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"] = {};
  68.                     bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"].initAsFoot();
  69.                     bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"].name = "right foot";
  70.                     bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"].parentPart = &bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"];
  71.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement