home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh17 / CH17LIST / Classes / CH17_01LIST.uc next >
Encoding:
Text File  |  2006-02-19  |  698 b   |  27 lines

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