2018-07-22 20:30:17 +00:00
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
2018-08-10 06:58:26 +00:00
|
|
|
{-# LANGUAGE TypeSynonymInstances #-}
|
|
|
|
{-# LANGUAGE FlexibleInstances #-}
|
2018-07-22 20:30:17 +00:00
|
|
|
module Object where
|
|
|
|
|
|
|
|
import Data.Ecstasy
|
|
|
|
|
2019-02-15 10:22:24 +00:00
|
|
|
-- internal imports
|
|
|
|
|
2018-07-22 20:30:17 +00:00
|
|
|
import Types
|
|
|
|
|
2019-02-15 10:22:24 +00:00
|
|
|
import Object.Computer
|
|
|
|
import Object.Copier
|
2019-02-16 19:38:00 +00:00
|
|
|
import Object.Door
|
2018-08-10 06:58:26 +00:00
|
|
|
|
2019-02-15 10:22:24 +00:00
|
|
|
instance ObjectAction ObjType ObjState where
|
2019-03-15 00:41:18 +00:00
|
|
|
objectAction dt t@ObjCopier s ent = copierObjectAction dt t s ent
|
2018-08-12 04:28:31 +00:00
|
|
|
|
2019-03-15 00:41:18 +00:00
|
|
|
objectAction dt t@ObjComputer s ent = computerObjectAction dt t s ent
|
2018-08-11 09:51:20 +00:00
|
|
|
|
2019-03-15 00:41:18 +00:00
|
|
|
objectAction dt t@ObjDoor s ent = doorObjectAction dt t s ent
|
2019-02-16 19:38:00 +00:00
|
|
|
|
2019-03-15 00:41:18 +00:00
|
|
|
objectAction _ _ _ _ = return ()
|
2018-08-10 06:58:26 +00:00
|
|
|
|
2019-02-15 10:22:24 +00:00
|
|
|
objectTransition t@ObjCopier s pa ent aent =
|
|
|
|
copierObjectTransition t s pa ent aent
|
2018-08-11 09:51:20 +00:00
|
|
|
|
2019-02-15 10:22:24 +00:00
|
|
|
objectTransition t@ObjComputer s pa ent aent =
|
|
|
|
computerObjectTransition t s pa ent aent
|
2018-08-10 06:58:26 +00:00
|
|
|
|
2019-02-16 19:38:00 +00:00
|
|
|
objectTransition t@ObjDoor s pa ent aent =
|
|
|
|
doorObjectTransition t s pa ent aent
|
2018-07-30 13:34:45 +00:00
|
|
|
|
2019-02-16 19:38:00 +00:00
|
|
|
objectTransition _ _ _ _ _ = return unchanged
|