home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh17 / CH17LIST / Classes / UtilityTestClass.uc < prev   
Encoding:
Text File  |  2006-02-19  |  717 b   |  32 lines

  1. // %PARAMETERS = "CH17LIST C:\UT2004"
  2. //Identifies the package
  3. //UtilityTestClass.uc
  4.  
  5. class UtilityTestClass extends Commandlet;
  6.  
  7. function int Main(string Args){
  8.  
  9.   //#1 declare an identifier of the Play type
  10.  
  11.   local Play firstPlay;
  12.  
  13.   //#2 create an instance of the class through the new keyword
  14.  
  15.   firstPlay = new class'Play';
  16.  
  17.   //#3 firstPlay.class provides you with the name of the package
  18.   //and the class
  19.  
  20.   Log(Chr(10) $ "UtilityTestClass" @ firstPlay.class $ Chr(10));
  21.   
  22.     //#4 Assign a value to the class attribute
  23.   firstPlay.setTitle("Prometheus Bound");
  24.  
  25.   //#5 Retrieve a value from the class attribute
  26.   Log("Play title: " $ firstPlay.getTitle() );
  27.  
  28.  
  29.   return 0;
  30. }
  31.  
  32.