home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh19 / CH19LIST / Classes / Element.uc < prev    next >
Encoding:
Text File  |  2006-02-25  |  2.9 KB  |  94 lines

  1. // %PARAMETERS = "CH19LIST C:\UT2004"
  2. //Identifies the package
  3. //Element.uc
  4. //Preconditions:
  5. //Element organizes the information relative to each line or
  6. //designated sequential step in the drama
  7. //The test driver for this class is CH19_02LIST
  8.  
  9. class Element extends Commandlet;
  10. //#1 Class attributes
  11.  var private string szSpeech;
  12.  var private string szDirection;
  13.  var private string szElementName;
  14.  var private Vector vPosition;
  15.  var private int iElementNum;
  16.  
  17. //---------------------------------------------------------
  18. //#2 Set up a basic element
  19.  public function setElement(string elDir,
  20.                             string elChar,
  21.                             string elSpeech,
  22.                             int elNum){
  23.     szDirection  = elDir;
  24.     szElementName  =  elChar;
  25.     szSpeech    =  elSpeech;
  26.     iElementNum =  elNum;
  27.  }
  28.  
  29.  
  30. //---------------------- getElementName -------------------
  31. //#3 Get the name of a character associated with an element
  32.  public function string getElementName(){
  33.     return szElementName;
  34.  }
  35. //---------------------- setElementName -------------------
  36.  public function setElementName(string eleName){
  37.     szElementName = eleName;
  38.  }
  39.  
  40. //----------------------getElementNum----------------------
  41. //#4 Retrieve assigned element number
  42.  public function int getElementNum(){
  43.     return iElementNum;
  44.  }
  45. //----------------------setElementNum----------------------
  46.  // Assign element number
  47.  public function setElementNum( int eleNum){
  48.     iElementNum = eleNum;
  49.  }
  50.  
  51. //----------------------- getSpeech-------------------------
  52. //#5 Retrieve the speech associated with an element
  53.  public function string getSpeech(){
  54.     return szSpeech;
  55.  }
  56.  //---------------------- setSpeech ------------------------
  57. //Assign the speech associated with an element
  58.  public function setSpeech(string eleSpeech){
  59.     szSpeech = eleSpeech;
  60.  }
  61.  
  62. //---------------------setDirection-------------------------
  63. //#6 Retrieve stage directions associated with an element
  64.  public function setDirection(string textForDir){
  65.    //Stage dramatic directions
  66.        szDirection  = textForDir;
  67.  }
  68. //---------------------getDirection-------------------------
  69. //  Retrieve stage directions associated with an element
  70.  public function string getDirection(){
  71.    //Stage dramatic directions
  72.      return szDirection;
  73.  }
  74.  
  75. //-------------------- getPosition ------------------------
  76. //#7 Assign the vector position of the Element object
  77. //Retrieve the position of the Element object
  78.  public function Vector getPosition(){
  79.      return vPosition;
  80.  }
  81.  
  82. //--------------------- setPosition -----------------------
  83.   public function setPosition(Vector vect){
  84.        vPosition = vect;
  85.   }
  86.   
  87.   //------------------- setPositionXYZ-----------------------
  88.   public function setPositionXYZ(float x, float y, float z){
  89.        vPosition.x = x;
  90.        vPosition.y = y;
  91.        vPosition.z = z;
  92.   }
  93.  
  94.