home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IO Examples / Scrabble / state.dcl < prev    next >
Encoding:
Modula Definition  |  1997-05-13  |  1.3 KB  |  34 lines  |  [TEXT/3PRM]

  1. definition module state
  2.  
  3.  
  4. from    deltaEventIO    import IOState
  5. import    board
  6.  
  7.  
  8. ::    *State
  9.     =    {    playmode        :: Playmode                //    The playing mode
  10.         ,    board            :: Board                //    The playing board
  11.         ,    player            :: Player                //    Who's move is it (Player1 or Player2)
  12.         ,    player1            :: Playerinfo            //    The information of player 1
  13.         ,    player2            :: Playerinfo            //    The information of player 2
  14.         ,    direction        :: Direction            //    Last direction chosen by a Person
  15.         ,    letterbox        :: [Char]                //    The current set of available letters
  16.         ,    lexicon            :: Tree                    //    The current list of valid words
  17.         ,    wordsadded        :: Bool                    //    Words have been added by the players
  18.         ,    dimensions        :: (Int,Int,Int,Int)    //    The smallest enclosing rectangle surrounding the layn words
  19.         ,    strength        :: Strength                //    Strength of the Computer player
  20.         ,    progress        :: Progress                //    The progress of a Computer player
  21.         ,    files            :: *Files                //    The file system
  22.         ,    random            :: [Int]                //    An infinite random Integer list
  23.         }
  24. ::    Playerinfo
  25.     =    {    kind            :: Playerkind            //    The kind of the player
  26.         ,    letters            :: [Char]                //    Letters of player
  27.         ,    points            :: Int                    //    Points of player
  28.         ,    placedword        :: Bool                    //    Player placed a word in last turn (initially True)
  29.         }
  30.  
  31. initstate        :: Files -> State
  32. initialisestate    :: State (IOState *s) -> (State,IOState *s)
  33. getboardletters    :: State -> ([Char],State)
  34.