home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / ObjectTcl-1.1 / examples / TicTacToe / Player.tcl < prev    next >
Encoding:
Text File  |  1995-06-30  |  491 b   |  30 lines

  1. otclInterface Player {
  2.  
  3.    # The name of the player
  4.    constructor {name}
  5.  
  6.    # The opponent player has challenged this player
  7.    # expecting a new Game to be returned
  8.    method challenge {opponent}
  9.  
  10.    method getName {}
  11. }
  12.  
  13. otclImplementation Player {
  14.  
  15.    constructor {n} {} {
  16.       set name $n
  17.       PlayerServer playerAvailable $name $this
  18.    }
  19.  
  20.    method challenge {opponent} {
  21.       return [otclNew Game X $this]
  22.    }
  23.  
  24.    method getName {} {
  25.       return $name
  26.    }
  27.  
  28.    attribute name
  29. }
  30.