# Path: roglick/engine/ecs/base.py
# class Entity(object):
#     """An Entity is really little more than a lookup key for Components"""
#     __slots__ = ("_eid",)
# 
#     def __init__(self, eid):
#         self._eid = eid
# 
#     def __repr__(self):
#         return "{name}({eid})".format(
#                 name=type(self).__name__,
#                 eid=self._eid)
# 
#     def __hash__(self):
#         return self._eid
# 
#     def __eq__(self, rhs):
#         return hash(self) == hash(rhs)


from roglick.engine.ecs import Entity


def test_entity_equality():
    e1 = Entity(1)
    e2 = Entity(1)

    # Different objects...
    assert id(e1) != id(e2)
    # ...but same Entity
    assert e1 == e2

def test_entity_unequality():
    e1 = Entity(1)
    e2 = Entity(2)

    # Different objects...
    assert id(e1) != id(e2)
    # ...and different Entities
    assert e1 != e2


# Path: roglick/engine/ecs/base.py
# class Entity(object):
#     """An Entity is really little more than a lookup key for Components"""
#     __slots__ = ("_eid",)
# 
#     def __init__(self, eid):
#         self._eid = eid
# 
#     def __repr__(self):
#         return "{name}({eid})".format(
#                 name=type(self).__name__,
#                 eid=self._eid)
# 
#     def __hash__(self):
#         return self._eid
# 
#     def __eq__(self, rhs):
#         return hash(self) == hash(rhs)


# Path: test/engine/ecs/test_entity.py
from roglick.engine.ecs import Entity



def test_entity_equality():
    e1 = Entity(1)
    e2 = Entity(1)

    # Different objects...
    assert id(e1) != id(e2)
    # ...but same Entity
    assert e1 == e2

def test_entity_unequality():
    e1 = Entity(1)
    e2 = Entity(2)

    # Different objects...
    assert id(e1) != id(e2)
    # ...and different Entities
    assert e1 != e2


def test_entity_dict_index():