Advertisement
Guest User

Untitled

a guest
May 25th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data Room = Room {title :: String, desc :: String, exits :: [RoomID], roomId :: RoomID, objects :: forall a . O.Object a => [a], people :: [P.Person]}
  2.  34  
  3.  35 {-
  4.  36  - Gives a human readable String of the Room
  5.  37 -}
  6.  38 roomString :: Room -> String
  7.  39 roomString r = (title r) ++ "\n\n" ++ (desc r) ++ (exitsString (exits r)) ++ (objectsString (objects r)) ++ (peopleString (people r))
  8.  40  
  9.  48 {-
  10.  49  - Gives a human readable String representation of the objects in the Room
  11.  50 -}
  12.  51 objectsString :: O.Object a => [a] -> String
  13.  52 objectsString [] = ""
  14.  53 objectsString objs = "\nYou can see: " ++ (L.intercalate ", " (O.names objs))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement