home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh20 / CH20LIST / Classes / SoundProp.uc < prev    next >
Encoding:
Text File  |  2006-02-28  |  1.6 KB  |  75 lines

  1. // %PARAMETERS = "CH20LIST C:\UT2004"
  2. //Identifies the package
  3. //SoundProp.uc
  4. //The test driver is CH20_07LIST
  5. //It extends the prop Class
  6. //#1
  7. class SoundProp extends Prop;
  8.  
  9. //#2 Class attributes
  10.  
  11. var private int iPlayPosition;
  12.  
  13.  
  14. //#3
  15. //-----------------------setSoundFileName---------------
  16.  public function setSoundFileName(string des){
  17.       szName = des;
  18.  
  19.  }
  20. //--------------------------init-----------------------
  21.  public function string getSoundFileName(){
  22.       return szName;
  23.  }
  24.  
  25. //#4
  26. //-----------------------getPPos---------------------
  27.  public function int getPPos(){
  28.    return iPlayPosition;
  29.  }
  30.  
  31. //------------------------setPPos---------------------
  32.  public function setPPos(int pos){
  33.     iPlayPosition = pos;
  34.  }
  35.  
  36. //#5
  37. //------------------------setAction--------------------
  38.  public function setAction(string des){
  39.  
  40.       if(des == "Play"){
  41.            szAction = "Playing";
  42.       }
  43.  
  44.       else if(des == "Pause"){
  45.            szAction = "Paused";
  46.       }
  47.       else{
  48.           Log("Set sound to play or pause.");
  49.       }
  50.   }
  51.  
  52. //------------------------getAction--------------------
  53.  public function string getAction(){
  54.       return szAction;
  55.  }
  56. //#6
  57. //---------------------setPrimaryX------------------
  58.  public function setPrimaryX(int xValue){
  59.  
  60.      local Vector locVec;
  61.      locVec.x = xValue;
  62.      Super.setPos(locVec);
  63.  }
  64.  
  65.  //---------------------getPrimaryX-------------------
  66.  public function float getPrimaryX(){
  67.      local Vector locVec;
  68.      locVec = Super.getPos();
  69.      return locVec.x;
  70.  }
  71.  
  72.  
  73.  
  74.  
  75.