home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH19LIST C:\UT2004"
- //Identifies the package
- //CH19_02LIST.uc
-
- //#1
- //Preconditions:
- //This class tests CH19LIST.Element
-
- class CH19_02LIST extends Commandlet;
- function int Main(string Args)
- {
- //#2
- local Element firstElement;
- local Vector vect;
- firstElement = new class'Element';
-
- Log(Chr(10)$ " Testing the Element class");
-
- //#3
- //initialize element, don't set the direction
- firstElement.setElement("None", //direction
- "Electra", //character
- "Am I to make thy rule of honor mine?", //speech
- 101); //element
-
- Log(Chr(10));
- Log(" Direction not yet set: [" $ firstElement.getDirection() $ "]");
- Log(Chr(10));
-
- //set the direction
- firstElement.setDirection("Still and angry.");
-
- //set the position
- firstElement.setPosition(vect);
-
- //---------------------------------------------------
-
- //define the vector at this point
- vect.x = 100;
- vect.y = 100;
- vect.z = 100;
-
- firstElement.setPosition(vect);
- //#4
- Log(" [" $ firstElement.getElementNum()$ "]");
- Log(" [" $ firstElement.getDirection() $ "]");
- Log(" " $ Caps(firstElement.getElementName()) $ ":");
- Log(" " $ firstElement.getSpeech());
-
- //verify vector operations
- vect = firstElement.getPosition();
- Log(" Position: " $ firstElement.getPosition() );
- firstElement.setPositionXYZ(vect.x, vect.y, 120);
- Log(" Move toward back: " $ firstElement.getPosition() );
-
- //#5
- firstElement.setElementNum(105);
- firstElement.setDirection("Meek");
- firstElement.setElementName("Chrysothemis");
- firstElement.setSpeech("When thou art wise, then thou shalt guide us both.");
- Log(Chr(10));
- Log(" [" $ firstElement.getElementNum()$ "]");
- Log(" [" $ firstElement.getDirection() $ "]");
- Log(" " $ Caps(firstElement.getElementName()) $ ":");
- Log(" " $ firstElement.getSpeech());
- return 0;
- }
-