Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

EntityComponentSystem

Syadeu edited this page Oct 22, 2021 · 5 revisions

Namespace: Syadeu.Presentation.Components
File: EntityComponentSystem.cs

unsafe internal sealed class EntityComponentSystem : PresentationSystemEntity<EntityComponentSystem>, INotifySystemModule<EntityNotifiedComponentModule>

EntityDataBase 를 상속받는 ObjectBase 들의 컴포넌트를 관리하는 시스템입니다.

Inheritance: PresentationSystemEntity<T> -> EntityComponentSystem
Implements: INotifySystemModule<T>

Overview

  • 1

Remarks

컴포넌트는 Dispose 패턴을 따르며, IDisposable 구현부를 컴포넌트가 상속받고 있으면 체크하여 해당 컴포넌트가 제거될 시 수행됩니다. INotifyComponent<T> 를 통해 상속받는 ObjectBase 가 지정된 부모가 파괴될 시 같이 파괴되도록 수행할 수 있습니다.

Description

사용자는 직접 이 시스템을 통하여 컴포넌트 관련 작업을 수행하는 것이 아닌, EntityData<T>.AddComponent<TComponent>(in TComponent) 등과 같은 확장 메소드를 통해 작업을 수행할 수 있습니다. 자세한 기능은 EntityExtensionMethods 를 참조하세요.

EntityComponentSystem (이하 컴포넌트 시스템) 은 IEntityComponent 를 상속받는 모든 struct 들의 정보를 수집하여 각각 고유의 인덱스를 부여하고, 이를 Runtime 중에서 실시간으로 정보를 읽고 쓸 수 있게 합니다. 각 컴포넌트에 대한 데이터 버퍼는 Initiailize stage 에서 미리 할당되어 사용되므로 사용자는 Runtime 중 새로운 컴포넌트를 선언할 수 없습니다.

Examples


Public Methods

Name Description
ComponentBufferSafetyCheck<TComponent>(out bool)
GetComponentBuffer<TComponent>
GetComponentBufferPointer<TComponent>
GetComponentBufferPointerIntPtr<TComponent>
AddComponent<TComponent>(in EntityData<IEntityData>)
RemoveComponent<TComponent>(EntityData<IEntityData>)
RemoveComponent(EntityData<IEntityData>, Type)
RemoveComponent(EntityData<IEntityData>, TypeInfo)
Deprecated
RemoveComponent(ObjectBase, Type)
RemoveNotifiedComponents(IObject, Action<EntityData<IEntityData>, Type>)
RemoveNotifiedComponents(EntityData<IEntityData>, Action<EntityData<IEntityData>, Type>)
HasComponent<TComponent>(EntityData<IEntityData>)
HasComponent(EntityData<IEntityData>, Type)
ref GetComponent<TComponent>(EntityData<IEntityData>)
GetComponentReadOnly<TComponent>(EntityData<IEntityData>)
GetComponentPointer<TComponent>(EntityData<IEntityData>)
- Interfaces
- Enums
- Attributes
- Abstract Classes
- Classes
- Structs
- Exceptions

- Syadeu.Presentation
- Syadeu.Collections
- Syadeu.Collections.Converters
- Syadeu.Collections.Proxy
- Syadeu.Presentation.Proxy
- Syadeu.Presentation.Internal
- Syadeu.Presentation.Entities
- Syadeu.Presentation.Attributes
- Syadeu.Presentation.Components
- Syadeu.Presentation.Actions
- Syadeu.Presentation.Render
  • CameraData
  • CameraFrustum
  • IntersectionType
  • RenderSystem
  • WorldCanvasSystem
- Syadeu.Presentation.Data
  • DataContainerSystem
  • DataObjectBase
  • EntityAnimationClipEventData
- Syadeu.Presentation.Events

Clone this wiki locally