Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data Room = Room {title :: String, desc :: String, exits :: [RoomID], roomId :: RoomID, objects :: forall a . O.Object a => [a], people :: [P.Person]}
- 34
- 35 {-
- 36 - Gives a human readable String of the Room
- 37 -}
- 38 roomString :: Room -> String
- 39 roomString r = (title r) ++ "\n\n" ++ (desc r) ++ (exitsString (exits r)) ++ (objectsString (objects r)) ++ (peopleString (people r))
- 40
- 48 {-
- 49 - Gives a human readable String representation of the objects in the Room
- 50 -}
- 51 objectsString :: O.Object a => [a] -> String
- 52 objectsString [] = ""
- 53 objectsString objs = "\nYou can see: " ++ (L.intercalate ", " (O.names objs))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement