Skip to content

Task-Implement ComponentRegistry, Signature updates, and EcsCore cleanup flow #8

@learncold

Description

@learncold

Summary

ComponentRegistry를 구현하고, EcsCore에서 entity/component 생명주기를 통합 관리한다. addComponent 시 entity 선검증, Signature 자동 갱신, destroyEntity 시 등록된 모든 storage의 cleanup flow를 구축한다.

Parent Issue

#1

Area

Engine

Target Sprint

Sprint 1

Scope

  • ComponentRegistry: 컴포넌트 타입별 고유 ID 발급 및 PackedComponentStorage<T> 중앙 관리
  • EcsCore: EntityRegistry + ComponentRegistry 통합 코어
    • addComponent: entity 유효성 선검증 → 컴포넌트 insert → Signature 비트 set
    • removeComponent: 미등록·미보유 시 조용히 무시, 보유 시 remove → Signature 비트 reset
    • destroyEntity: notifyEntityDestroyed로 등록된 모든 storage cleanup 후 entity 슬롯 반환
  • EcsCoreTests: 생명주기, add/remove, stale entity 방어, cleanup flow, 인덱스 재사용, 독립 signature 비트 검증

Acceptance Criteria

  • ComponentRegistry가 타입별 ID를 일관성 있게 발급하고 storage를 관리한다
  • stale entity로 addComponent 호출 시 예외가 발생하고 storage가 변이되지 않는다
  • addComponent / removeComponententityRegistry().signatureOf(e).test(typeId)Signature 비트 갱신을 직접 검증할 수 있다
  • destroyEntity 시 등록된 모든 storage에서 해당 entity의 데이터가 제거된다
  • 인덱스 재사용 시 이전 entity의 컴포넌트가 새 entity에 유출되지 않는다

Architecture / Dependency Check

  • 구현 파일은 src/engine 안에만 둔다
  • engine이 domain 또는 application을 include하지 않는다
  • Qt 코드를 포함하지 않는다
  • include 경로는 engine/... 기준을 유지한다

Verification Plan

  • cmake --preset windows-debug-no-app
  • cmake --build --preset build-no-app-debug
  • ctest --preset test-no-app-debug
  • EcsCoreTests 전체 통과

Dependencies / Blockers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions