{-
  This module is part of Antisplice.
  Copyleft (c) 2014 Marvin Cohrs

  All wrongs reversed. Sharing is an act of love, not crime.
  Please share Antisplice with everyone you like.

  Antisplice is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Antisplice is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with Antisplice. If not, see <http://www.gnu.org/licenses/>.
-}

-- | Provides the error datatype for Antisplice
module Game.Antisplice.Errors where

import Data.Chatty.Fail

-- | Antisplice errors
data SplErr = UnknownError
            | QuitError                  -- ^ Triggers program termination
            | DoneError                  -- ^ Escape the waiter loop
            | UnintellegibleError        -- ^ "I don't understand that."
            | VerbMustFirstError         -- ^ "Please start with a verb."
            | CantSeeOneError            -- ^ "I can't see one here."
            | DontCarryOneError          -- ^ "You don't carry one."
            | WhichOneError              -- ^ "Which one do you mean?"
            | CantEquipThatError         -- ^ "I can't equip that."
            | CantEquipThatThereError    -- ^ "I can't wear that there. You might want to try some other place?"
            | WhereToEquipError          -- ^ "Where?"
            | CantCastThatNowError       -- ^ "Sorry, I can't cast that now. Check you health, mana and cooldowns."
            | CantWalkThereError         -- ^ "I can't walk there."
            | CantAcquireThatError       -- ^ "I can't take that."
            | WontHitThatError           -- ^ "I won't hit that."
            | WrongMethodError           -- ^ "Wrong method for creating that."
            | ReError ReError            -- ^ To embed ReErrors
            deriving Show

-- | Antisplice new errors
data ReError = Unint Int String
             | Uncon String
             | Forward String
             | Bye
             deriving (Eq,Ord,Show)

-- | Alias for 'FailT' 'SplErr'
type SplErrT m = FailT SplErr m