Skip to content

Can I feel free to use my class in component? #1098

@atkdefender

Description

@atkdefender

Ask AI, it says "Your component-embedded class leads to multiple pointer jumps, further reducing CPU cache hit rate.". It's that ture? Should I care about that?
What if my class in component has function in it? Different answer?

public struct HealthComponent : IComponent {
    public int CurrentHP;
    public int MaxHP;
}

From ↑ to ↓

public class HealthComponent : IComponent {
    public HealthData Health; 
}

public class HealthData { 
    public int CurrentHP;
    public int MaxHP;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions