Komodo Engine
C PROJECT_LOGO=
Komodo.Core.ECS.Entities.Entity Class Reference

Represents a collection of Komodo.Core.ECS.Components.Component objects tracked by the relevant Komodo.Core.ECS.Systems.ISystem objects. More...

Public Member Functions

 Entity ([NotNull] Game game)
 
Parameters
gameReference to current Komodo.Core.Game instance.

 
bool AddComponent ([NotNull] Component component)
 Adds a Komodo.Core.ECS.Components.Component to the relevant Komodo.Core.ECS.Systems.ISystem. AddComponent(Component) will also remove the Komodo.Core.ECS.Components.Component from any Entity and Komodo.Core.ECS.Systems.ISystem it was attached to before. More...
 
void ClearComponents ()
 Removes all Komodo.Core.ECS.Components.Component objects from the Entity. More...
 
bool RemoveComponent ([NotNull] Component component)
 Removes an individual Komodo.Core.ECS.Components.Component from this Entity's Components. More...
 

Public Attributes

Matrix RotationMatrix => Matrix.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z)
 Rotation in world space as a Microsoft.Xna.Framework.Matrix. More...
 
Quaternion RotationQuaternion => Quaternion.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z)
 Rotation in world space as a Microsoft.Xna.Framework.Quaternion. More...
 

Properties

List< ComponentComponents [get]
 All tracked Komodo.Core.ECS.Components.Component objects. More...
 
Game Game [get]
 Reference to current Komodo.Core.Game instance. More...
 
Guid ID [get]
 Unique identifier for the Entity. More...
 
bool IsEnabled [get, set]
 Whether or not the Entity and all child Components should be drawn or updated. More...
 
PhysicsSystem PhysicsSystem [get, set]
 Defines what Komodo.Core.ECS.Systems.PhysicsSystem should be used to simulate Komodo.Core.ECS.Components.PhysicsComponent objects. This allows for Komodo.Core.ECS.Components.PhsyicsComponent objects to simulate specific subsets of all Entity objects. More...
 
Vector3 Position [get, set]
 Position in world space. Used by Komodo.Core.ECS.Components.Component objects to determine their world space. More...
 
Render2DSystem Render2DSystem [get, set]
 Defines what Komodo.Core.ECS.Systems.Render2DSystem should be used to render Komodo.Core.ECS.Components.Drawable2DComponent objects. This allows for Komodo.Core.ECS.Components.CameraComponent objects to render specific subsets of all Entity objects. More...
 
Render3DSystem Render3DSystem [get, set]
 Defines what Komodo.Core.ECS.Systems.Render3DSystem should be used to render Komodo.Core.ECS.Components.Drawable3DComponent objects. This allows for Komodo.Core.ECS.Components.CameraComponent objects to render specific subsets of all Entity objects. More...
 
Vector3 Rotation [get, set]
 Rotation in world space. More...
 
Vector3 Scale [get, set]
 Scaling for the entire entity. Scales all child Komodo.Core.ECS.Components.Component objects. More...
 

Detailed Description

Represents a collection of Komodo.Core.ECS.Components.Component objects tracked by the relevant Komodo.Core.ECS.Systems.ISystem objects.

Member Function Documentation

◆ AddComponent()

bool Komodo.Core.ECS.Entities.Entity.AddComponent ( [NotNull] Component  component)

Adds a Komodo.Core.ECS.Components.Component to the relevant Komodo.Core.ECS.Systems.ISystem. AddComponent(Component) will also remove the Komodo.Core.ECS.Components.Component from any Entity and Komodo.Core.ECS.Systems.ISystem it was attached to before.

Parameters
componentKomodo.Core.ECS.Components.Component to add.
Returns
Whether or not the Komodo.Core.ECS.Components.Component was added to this Entity's Components. Returns false if the Komodo.Core.ECS.Components.Component already existed.

◆ ClearComponents()

void Komodo.Core.ECS.Entities.Entity.ClearComponents ( )

Removes all Komodo.Core.ECS.Components.Component objects from the Entity.

◆ RemoveComponent()

bool Komodo.Core.ECS.Entities.Entity.RemoveComponent ( [NotNull] Component  component)

Removes an individual Komodo.Core.ECS.Components.Component from this Entity's Components.

Parameters
componentKomodo.Core.ECS.Components.Component to remove.
Returns
Whether or not the Komodo.Core.ECS.Components.Component was removed from this Entity's Components. Will return false if the Komodo.Core.ECS.Components.Component is not present in Components.

Member Data Documentation

◆ RotationMatrix

Matrix Komodo.Core.ECS.Entities.Entity.RotationMatrix => Matrix.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z)

Rotation in world space as a Microsoft.Xna.Framework.Matrix.

◆ RotationQuaternion

Quaternion Komodo.Core.ECS.Entities.Entity.RotationQuaternion => Quaternion.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z)

Rotation in world space as a Microsoft.Xna.Framework.Quaternion.

Property Documentation

◆ Components

List<Component> Komodo.Core.ECS.Entities.Entity.Components
get

◆ Game

Game Komodo.Core.ECS.Entities.Entity.Game
get

Reference to current Komodo.Core.Game instance.

◆ ID

Guid Komodo.Core.ECS.Entities.Entity.ID
get

Unique identifier for the Entity.

◆ IsEnabled

bool Komodo.Core.ECS.Entities.Entity.IsEnabled
getset

Whether or not the Entity and all child Components should be drawn or updated.

◆ PhysicsSystem

PhysicsSystem Komodo.Core.ECS.Entities.Entity.PhysicsSystem
getset

Defines what Komodo.Core.ECS.Systems.PhysicsSystem should be used to simulate Komodo.Core.ECS.Components.PhysicsComponent objects. This allows for Komodo.Core.ECS.Components.PhsyicsComponent objects to simulate specific subsets of all Entity objects.

◆ Position

Vector3 Komodo.Core.ECS.Entities.Entity.Position
getset

Position in world space. Used by Komodo.Core.ECS.Components.Component objects to determine their world space.

◆ Render2DSystem

Render2DSystem Komodo.Core.ECS.Entities.Entity.Render2DSystem
getset

Defines what Komodo.Core.ECS.Systems.Render2DSystem should be used to render Komodo.Core.ECS.Components.Drawable2DComponent objects. This allows for Komodo.Core.ECS.Components.CameraComponent objects to render specific subsets of all Entity objects.

◆ Render3DSystem

Render3DSystem Komodo.Core.ECS.Entities.Entity.Render3DSystem
getset

Defines what Komodo.Core.ECS.Systems.Render3DSystem should be used to render Komodo.Core.ECS.Components.Drawable3DComponent objects. This allows for Komodo.Core.ECS.Components.CameraComponent objects to render specific subsets of all Entity objects.

◆ Rotation

Vector3 Komodo.Core.ECS.Entities.Entity.Rotation
getset

Rotation in world space.

◆ Scale

Vector3 Komodo.Core.ECS.Entities.Entity.Scale
getset

Scaling for the entire entity. Scales all child Komodo.Core.ECS.Components.Component objects.