summaryrefslogtreecommitdiff
path: root/main/Test/State.hs
blob: 3ef155878e3a3721eb792b1f213576571f1fcc0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Test.State (
    CustomSharedState(..),
) where

import Data.Proxy

import GHC.TypeLits

import Erebos.Object
import Erebos.State
import Erebos.Storage.Merge


data CustomSharedState (tid :: Symbol) = CustomSharedState
    { customStateComponents :: StoredTips Object
    }

instance Mergeable (CustomSharedState tid) where
    type Component (CustomSharedState tid) = Object
    toComponents = customStateComponents
    mergeSorted = CustomSharedState

instance KnownSymbol tid => SharedType (CustomSharedState tid) where
    sharedTypeID _ = mkSharedTypeID (symbolVal @tid Proxy)