-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,133 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{-# LANGUAGE DerivingVia #-} | ||
|
||
module Swarm.Game.Scenario.EntityFacade where | ||
|
||
import Control.Lens hiding (from, (.=), (<.>)) | ||
import Data.Text (Text) | ||
import Data.Yaml as Y | ||
import Swarm.Game.Display (Display) | ||
import Swarm.Game.Entity qualified as E | ||
|
||
type EntityName = Text | ||
|
||
data EntityFacadeData = EntityFacadeData EntityName Display | ||
deriving (Eq) | ||
|
||
-- Note: This instance is used only for the purpose of WorldPalette | ||
instance ToJSON EntityFacadeData where | ||
toJSON (EntityFacadeData eName _display) = toJSON eName | ||
|
||
mkPaint :: E.Entity -> EntityFacadeData | ||
mkPaint e = | ||
EntityFacadeData | ||
(e ^. E.entityName) | ||
(e ^. E.entityDisplay) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.