Browse files

mkCard

  • Loading branch information...
1 parent 8dbb21f commit 8be143585ad58ca317ac71c5ca5ae7ffca6373cb @MedeaMelana committed Aug 31, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −1 BasicLands.hs
  2. +3 −0 Utils.hs
View
2 BasicLands.hs
@@ -22,7 +22,7 @@ mountain = mkBasicLandCard Mountain Red
forest = mkBasicLandCard Forest Green
mkBasicLandCard :: LandType -> Color -> Card
-mkBasicLandCard ty color = Card $ \ts rOwner zone -> (object ts rOwner zone)
+mkBasicLandCard ty color = mkCard $ \o -> o
{ _name = Just (fromString (show ty))
, _types = basicType <> objectType ty
, _play = Just playLand
View
3 Utils.hs
@@ -10,6 +10,9 @@ import Data.Set (Set)
import qualified Data.Set as Set
+mkCard :: (Object -> Object) -> Card
+mkCard f = Card (\ts rOwner zone -> f (object ts rOwner zone))
+
object :: Timestamp -> Ref Player -> Zone -> Object
object ts rOwner zone = Object
{ _name = Nothing

0 comments on commit 8be1435

Please sign in to comment.