--- a/netserver/Miscutils.hs Thu Oct 09 13:01:52 2008 +0000
+++ b/netserver/Miscutils.hs Thu Oct 09 13:43:47 2008 +0000
@@ -33,6 +33,7 @@
teamgrave :: String,
teamfort :: String,
difficulty :: Int,
+ hhnum :: Int,
hedgehogs :: [HedgehogInfo]
}
@@ -109,3 +110,13 @@
room : rms
else
room : modifyRoom room rms
+
+modifyTeam :: RoomInfo -> TeamInfo -> RoomInfo
+modifyTeam room team = room{teams = replaceTeam team $ teams room}
+ where
+ replaceTeam _ [] = error "modifyTeam: no such team"
+ replaceTeam team (t:teams) =
+ if teamname team == teamname t then
+ team : teams
+ else
+ t : replaceTeam team teams