tracer/src/Object/ActionTime.hs

26 lines
596 B
Haskell
Raw Normal View History

2019-02-16 19:38:00 +00:00
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Object.ActionTime where
import Affection as A
2019-10-28 17:20:34 +00:00
import Data.String
2019-02-16 19:38:00 +00:00
-- internal imports
import Types
instance ActionTime ObjType ObjState where
actionTime ObjCopier "copying" = 5
actionTime ObjComputer "off" = 0
actionTime ObjComputer "on" = 20
actionTime ObjComputer "hack" = 20
actionTime ObjComputer "hack" = 20
actionTime ObjDoor "open" = 2
2019-10-28 17:20:34 +00:00
actionTime o s = A.log
Error
(fromString (show o) <> ": " <> fromString s <> ": has not a time")
0