Skip to content

Game.Prefabs.EducationParameterData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: IComponentData, IQueryTypeParameter

Summary:
Component data that holds configuration parameters for education-related prefabs and simulation probabilities. This struct is a DOTS ECS component (value type) intended to be attached to an entity (typically an education prefab or a prefab container) and read by systems that simulate education behavior (school availability, progression to high school, adults returning to school, and workers continuing education). Probabilities are expressed as floating-point values (typically in the range 0.0 to 1.0).


Fields

  • public Entity m_EducationServicePrefab
    Reference to the Entity representing the education service prefab (e.g., a school building prefab). Typically set to the prefab Entity used when spawning education buildings or services.

  • public float m_InoperableSchoolLeaveProbability
    Probability that individuals (students) will leave school or otherwise be affected when a school becomes inoperable. Value is expected to be between 0 and 1.

  • public float m_EnterHighSchoolProbability
    Probability that a student will enter high school (used when simulating progression from basic education to high school). Value is expected to be between 0 and 1.

  • public float m_AdultEnterHighSchoolProbability
    Probability that an adult will enter high school (i.e., adults returning to further education). Value is expected to be between 0 and 1.

  • public float m_WorkerContinueEducationProbability
    Probability that a worker will continue education (e.g., pursue additional training or schooling while employed). Value is expected to be between 0 and 1.

Properties

  • None (this struct exposes public fields rather than properties)

Constructors

  • public EducationParameterData()
    Default value-type constructor provided by C#. You can initialize the fields inline or using an object initializer when creating an instance.

Methods

  • None (no methods defined on this component)

Usage Example

// Example: creating and attaching the component to an entity using EntityManager
var eduParams = new Game.Prefabs.EducationParameterData
{
    m_EducationServicePrefab = educationPrefabEntity, // an Entity reference to the school prefab
    m_InoperableSchoolLeaveProbability = 0.25f,
    m_EnterHighSchoolProbability = 0.80f,
    m_AdultEnterHighSchoolProbability = 0.10f,
    m_WorkerContinueEducationProbability = 0.15f
};

// Add the component to an existing entity (e.g., a prefab container entity)
entityManager.AddComponentData(targetEntity, eduParams);

// In a system, read the data (example using Entities.ForEach in DOTS):
Entities.ForEach((ref Game.Prefabs.EducationParameterData p) =>
{
    // Use p.m_EnterHighSchoolProbability, etc. to influence simulation logic
}).Schedule();

Notes: - m_EducationServicePrefab should be set to a converted prefab Entity (from authoring conversion) if you intend to instantiate or reference the prefab at runtime. - Probabilities are typically 0.0–1.0. Systems consuming this component should validate/clip values if necessary.