Skip to content
Snippets Groups Projects
Commit 919f57bf authored by stuebinm's avatar stuebinm
Browse files

map format: turns out more things are optional

the unhelpfulness of the spec is slowly starting to grate …

Anyways, apparently a lot more properties don't have to be present, and
you find out by finding maps somewhere that work but currently fail the
parser.
parent a13383cf
No related branches found
No related tags found
No related merge requests found
...@@ -97,13 +97,13 @@ data Object = Object { objectId :: Int ...@@ -97,13 +97,13 @@ data Object = Object { objectId :: Int
-- ^ Width in pixels. Ignored if using a gid. -- ^ Width in pixels. Ignored if using a gid.
, objectHeight :: Double , objectHeight :: Double
-- ^ Height in pixels. Ignored if using a gid. -- ^ Height in pixels. Ignored if using a gid.
, objectName :: String , objectName :: Maybe String
-- ^ String assigned to name field in editor -- ^ String assigned to name field in editor
, objectType :: String , objectType :: String
-- ^ String assigned to type field in editor -- ^ String assigned to type field in editor
, objectProperties :: Map Text Text , objectProperties :: Maybe Value
-- ^ String key-value pairs -- ^ String key-value pairs
, objectVisible :: Bool , objectVisible :: Maybe Bool
-- ^ Whether object is shown in editor. -- ^ Whether object is shown in editor.
, objectX :: Double , objectX :: Double
-- ^ x coordinate in pixels -- ^ x coordinate in pixels
...@@ -113,13 +113,13 @@ data Object = Object { objectId :: Int ...@@ -113,13 +113,13 @@ data Object = Object { objectId :: Int
-- ^ Angle in degrees clockwise -- ^ Angle in degrees clockwise
, objectGid :: Maybe GlobalId , objectGid :: Maybe GlobalId
-- ^ GID, only if object comes from a Tilemap -- ^ GID, only if object comes from a Tilemap
, objectEllipse :: Bool , objectEllipse :: Maybe Bool
-- ^ Used to mark an object as an ellipse -- ^ Used to mark an object as an ellipse
, objectPolygon :: Maybe (Vector (Double, Double)) , objectPolygon :: Maybe (Vector (Double, Double))
-- ^ A list of x,y coordinates in pixels -- ^ A list of x,y coordinates in pixels
, objectPolyline :: Maybe (Vector (Double, Double)) , objectPolyline :: Maybe (Vector (Double, Double))
-- ^ A list of x,y coordinates in pixels -- ^ A list of x,y coordinates in pixels
, objectText :: Map Text Text , objectText :: Maybe Value
-- ^ String key-value pairs -- ^ String key-value pairs
} deriving (Eq, Generic, Show) } deriving (Eq, Generic, Show)
...@@ -276,7 +276,7 @@ instance ToJSON Tileset where ...@@ -276,7 +276,7 @@ instance ToJSON Tileset where
-- | The full monty. -- | The full monty.
data Tiledmap = Tiledmap { tiledmapVersion :: Float data Tiledmap = Tiledmap { tiledmapVersion :: Value
-- ^ The JSON format version -- ^ The JSON format version
, tiledmapTiledversion :: String , tiledmapTiledversion :: String
-- ^ The Tiled version used to save the file -- ^ The Tiled version used to save the file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment