{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

-- |
-- Module      : Aztecs.ECS.Component.Internal
-- Copyright   : (c) Matt Hunzinger, 2025
-- License     : BSD-style (see the LICENSE file in the distribution)
--
-- Maintainer  : matt@hunzinger.me
-- Stability   : provisional
-- Portability : non-portable (GHC extensions)
module Aztecs.ECS.Component.Internal (ComponentID (..)) where

import GHC.Generics

-- | Unique component identifier.
newtype ComponentID = ComponentID
  { -- | Unique integer identifier.
    ComponentID -> Int
unComponentId :: Int
  }
  deriving (ComponentID -> ComponentID -> Bool
(ComponentID -> ComponentID -> Bool)
-> (ComponentID -> ComponentID -> Bool) -> Eq ComponentID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ComponentID -> ComponentID -> Bool
== :: ComponentID -> ComponentID -> Bool
$c/= :: ComponentID -> ComponentID -> Bool
/= :: ComponentID -> ComponentID -> Bool
Eq, Eq ComponentID
Eq ComponentID =>
(ComponentID -> ComponentID -> Ordering)
-> (ComponentID -> ComponentID -> Bool)
-> (ComponentID -> ComponentID -> Bool)
-> (ComponentID -> ComponentID -> Bool)
-> (ComponentID -> ComponentID -> Bool)
-> (ComponentID -> ComponentID -> ComponentID)
-> (ComponentID -> ComponentID -> ComponentID)
-> Ord ComponentID
ComponentID -> ComponentID -> Bool
ComponentID -> ComponentID -> Ordering
ComponentID -> ComponentID -> ComponentID
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ComponentID -> ComponentID -> Ordering
compare :: ComponentID -> ComponentID -> Ordering
$c< :: ComponentID -> ComponentID -> Bool
< :: ComponentID -> ComponentID -> Bool
$c<= :: ComponentID -> ComponentID -> Bool
<= :: ComponentID -> ComponentID -> Bool
$c> :: ComponentID -> ComponentID -> Bool
> :: ComponentID -> ComponentID -> Bool
$c>= :: ComponentID -> ComponentID -> Bool
>= :: ComponentID -> ComponentID -> Bool
$cmax :: ComponentID -> ComponentID -> ComponentID
max :: ComponentID -> ComponentID -> ComponentID
$cmin :: ComponentID -> ComponentID -> ComponentID
min :: ComponentID -> ComponentID -> ComponentID
Ord, Int -> ComponentID -> ShowS
[ComponentID] -> ShowS
ComponentID -> String
(Int -> ComponentID -> ShowS)
-> (ComponentID -> String)
-> ([ComponentID] -> ShowS)
-> Show ComponentID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ComponentID -> ShowS
showsPrec :: Int -> ComponentID -> ShowS
$cshow :: ComponentID -> String
show :: ComponentID -> String
$cshowList :: [ComponentID] -> ShowS
showList :: [ComponentID] -> ShowS
Show, (forall x. ComponentID -> Rep ComponentID x)
-> (forall x. Rep ComponentID x -> ComponentID)
-> Generic ComponentID
forall x. Rep ComponentID x -> ComponentID
forall x. ComponentID -> Rep ComponentID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ComponentID -> Rep ComponentID x
from :: forall x. ComponentID -> Rep ComponentID x
$cto :: forall x. Rep ComponentID x -> ComponentID
to :: forall x. Rep ComponentID x -> ComponentID
Generic)