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

-- |

-- Module      : Aztecs.ECS.Entity

-- 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.Entity (EntityID (..)) where

import Control.DeepSeq
import GHC.Generics

-- | Unique entity identifier.

--

-- @since 0.9

newtype EntityID = EntityID
  { -- | Unique integer identifier.

    --

    -- @since 0.9

    EntityID -> Int
unEntityId :: Int
  }
  deriving (EntityID -> EntityID -> Bool
(EntityID -> EntityID -> Bool)
-> (EntityID -> EntityID -> Bool) -> Eq EntityID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EntityID -> EntityID -> Bool
== :: EntityID -> EntityID -> Bool
$c/= :: EntityID -> EntityID -> Bool
/= :: EntityID -> EntityID -> Bool
Eq, Eq EntityID
Eq EntityID =>
(EntityID -> EntityID -> Ordering)
-> (EntityID -> EntityID -> Bool)
-> (EntityID -> EntityID -> Bool)
-> (EntityID -> EntityID -> Bool)
-> (EntityID -> EntityID -> Bool)
-> (EntityID -> EntityID -> EntityID)
-> (EntityID -> EntityID -> EntityID)
-> Ord EntityID
EntityID -> EntityID -> Bool
EntityID -> EntityID -> Ordering
EntityID -> EntityID -> EntityID
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 :: EntityID -> EntityID -> Ordering
compare :: EntityID -> EntityID -> Ordering
$c< :: EntityID -> EntityID -> Bool
< :: EntityID -> EntityID -> Bool
$c<= :: EntityID -> EntityID -> Bool
<= :: EntityID -> EntityID -> Bool
$c> :: EntityID -> EntityID -> Bool
> :: EntityID -> EntityID -> Bool
$c>= :: EntityID -> EntityID -> Bool
>= :: EntityID -> EntityID -> Bool
$cmax :: EntityID -> EntityID -> EntityID
max :: EntityID -> EntityID -> EntityID
$cmin :: EntityID -> EntityID -> EntityID
min :: EntityID -> EntityID -> EntityID
Ord, Int -> EntityID -> ShowS
[EntityID] -> ShowS
EntityID -> String
(Int -> EntityID -> ShowS)
-> (EntityID -> String) -> ([EntityID] -> ShowS) -> Show EntityID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EntityID -> ShowS
showsPrec :: Int -> EntityID -> ShowS
$cshow :: EntityID -> String
show :: EntityID -> String
$cshowList :: [EntityID] -> ShowS
showList :: [EntityID] -> ShowS
Show, (forall x. EntityID -> Rep EntityID x)
-> (forall x. Rep EntityID x -> EntityID) -> Generic EntityID
forall x. Rep EntityID x -> EntityID
forall x. EntityID -> Rep EntityID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. EntityID -> Rep EntityID x
from :: forall x. EntityID -> Rep EntityID x
$cto :: forall x. Rep EntityID x -> EntityID
to :: forall x. Rep EntityID x -> EntityID
Generic, EntityID -> ()
(EntityID -> ()) -> NFData EntityID
forall a. (a -> ()) -> NFData a
$crnf :: EntityID -> ()
rnf :: EntityID -> ()
NFData)