home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH19LIST C:\UT2004"
- //Identifies the package
- //Element.uc
- //Preconditions:
- //Element organizes the information relative to each line or
- //designated sequential step in the drama
- //The test driver for this class is CH19_02LIST
-
- class Element extends Commandlet;
- //#1 Class attributes
- var private string szSpeech;
- var private string szDirection;
- var private string szElementName;
- var private Vector vPosition;
- var private int iElementNum;
-
- //---------------------------------------------------------
- //#2 Set up a basic element
- public function setElement(string elDir,
- string elChar,
- string elSpeech,
- int elNum){
- szDirection = elDir;
- szElementName = elChar;
- szSpeech = elSpeech;
- iElementNum = elNum;
- }
-
-
- //---------------------- getElementName -------------------
- //#3 Get the name of a character associated with an element
- public function string getElementName(){
- return szElementName;
- }
- //---------------------- setElementName -------------------
- public function setElementName(string eleName){
- szElementName = eleName;
- }
-
- //----------------------getElementNum----------------------
- //#4 Retrieve assigned element number
- public function int getElementNum(){
- return iElementNum;
- }
- //----------------------setElementNum----------------------
- // Assign element number
- public function setElementNum( int eleNum){
- iElementNum = eleNum;
- }
-
- //----------------------- getSpeech-------------------------
- //#5 Retrieve the speech associated with an element
- public function string getSpeech(){
- return szSpeech;
- }
- //---------------------- setSpeech ------------------------
- //Assign the speech associated with an element
- public function setSpeech(string eleSpeech){
- szSpeech = eleSpeech;
- }
-
- //---------------------setDirection-------------------------
- //#6 Retrieve stage directions associated with an element
- public function setDirection(string textForDir){
- //Stage dramatic directions
- szDirection = textForDir;
- }
- //---------------------getDirection-------------------------
- // Retrieve stage directions associated with an element
- public function string getDirection(){
- //Stage dramatic directions
- return szDirection;
- }
-
- //-------------------- getPosition ------------------------
- //#7 Assign the vector position of the Element object
- //Retrieve the position of the Element object
- public function Vector getPosition(){
- return vPosition;
- }
-
- //--------------------- setPosition -----------------------
- public function setPosition(Vector vect){
- vPosition = vect;
- }
-
- //------------------- setPositionXYZ-----------------------
- public function setPositionXYZ(float x, float y, float z){
- vPosition.x = x;
- vPosition.y = y;
- vPosition.z = z;
- }
-
-