Add Staircase to the list of all entities

Forgot to do this when I added staircases - this is necessary for
loading saved games.
This commit is contained in:
Griffin Smith 2020-02-17 13:14:12 -05:00
parent 25a1c5ade3
commit f6eeccbb0f

View file

@ -26,6 +26,7 @@ instance Arbitrary SomeEntity where
, SomeEntity <$> arbitrary @Wall , SomeEntity <$> arbitrary @Wall
, SomeEntity <$> arbitrary @Door , SomeEntity <$> arbitrary @Door
, SomeEntity <$> arbitrary @GroundMessage , SomeEntity <$> arbitrary @GroundMessage
, SomeEntity <$> arbitrary @Staircase
] ]
instance FromJSON SomeEntity where instance FromJSON SomeEntity where
@ -38,6 +39,7 @@ instance FromJSON SomeEntity where
"Wall" -> SomeEntity @Wall <$> obj .: "data" "Wall" -> SomeEntity @Wall <$> obj .: "data"
"Door" -> SomeEntity @Door <$> obj .: "data" "Door" -> SomeEntity @Door <$> obj .: "data"
"GroundMessage" -> SomeEntity @GroundMessage <$> obj .: "data" "GroundMessage" -> SomeEntity @GroundMessage <$> obj .: "data"
"Staircase" -> SomeEntity @Staircase <$> obj .: "data"
_ -> fail . unpack $ "Invalid entity type \"" <> entityType <> "\"" _ -> fail . unpack $ "Invalid entity type \"" <> entityType <> "\""
deriving via WithOptions '[ FieldLabelModifier '[Drop 1] ] GameLevel deriving via WithOptions '[ FieldLabelModifier '[Drop 1] ] GameLevel