Skip to content

Commit

Permalink
add datastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed Sep 17, 2024
1 parent 5878da3 commit 71847c8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/swarm-scenario/Swarm/Game/Display.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,41 @@ data ChildInheritance
| DefaultDisplay
deriving (Eq, Ord, Show, Generic, Hashable)

data Presence
= -- | present
X

Check warning on line 89 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: data constructor ‘X’
| -- | absent
O

Check warning on line 91 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: data constructor ‘O’

data Neighbors a = Neighbors

Check warning on line 93 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: data constructor ‘Neighbors’
{ e :: a

Check warning on line 94 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: record field of Neighbors ‘e’
, w :: a

Check warning on line 95 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: record field of Neighbors ‘w’
, n :: a

Check warning on line 96 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: record field of Neighbors ‘n’
, s :: a

Check warning on line 97 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: record field of Neighbors ‘s’
}

-- | For a center cell that itself is a boundary,
-- what should it be rendered as, given certain
-- neighbor combinations?
getBoundaryDisplay :: Neighbors Presence -> Maybe Char
getBoundaryDisplay = \case

Check warning on line 104 in src/swarm-scenario/Swarm/Game/Display.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - windows-latest - ghc-9.8.2

Defined but not used: ‘getBoundaryDisplay’
Neighbors {e = O, w = O, n = O, s = O} -> Nothing
Neighbors {e = X, w = X, n = O, s = O} -> Just ''
Neighbors {e = X, w = O, n = O, s = O} -> Just ''
Neighbors {e = O, w = X, n = O, s = O} -> Just ''
Neighbors {e = O, w = O, n = X, s = X} -> Just ''
Neighbors {e = O, w = O, n = O, s = X} -> Just ''
Neighbors {e = O, w = O, n = X, s = O} -> Just ''
Neighbors {e = X, w = X, n = X, s = X} -> Just ''
Neighbors {e = O, w = X, n = O, s = X} -> Just ''
Neighbors {e = X, w = O, n = O, s = X} -> Just ''
Neighbors {e = O, w = X, n = X, s = O} -> Just ''
Neighbors {e = X, w = O, n = X, s = O} -> Just ''
Neighbors {e = O, w = X, n = X, s = X} -> Just ''
Neighbors {e = X, w = O, n = X, s = X} -> Just ''
Neighbors {e = X, w = X, n = X, s = O} -> Just ''
Neighbors {e = X, w = X, n = O, s = X} -> Just ''

-- | A record explaining how to display an entity in the TUI.
data Display = Display
{ _defaultChar :: Char
Expand Down

0 comments on commit 71847c8

Please sign in to comment.