© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4mo ago•
1 reply
BushyCreate

How do i get another's elements data from a element in a list?

    class Main
    {
        List<Ent> entis; // Contains EntA and EntB
    }
    abstract class Ent
    {
    }

    class EntA : Ent 
    {
        int Gold = 100;

        // How do i get the EntB class in the entis list from this class?
    }
    class EntB : Ent
    {
        float Position = 25.2f;
    }
    class Main
    {
        List<Ent> entis; // Contains EntA and EntB
    }
    abstract class Ent
    {
    }

    class EntA : Ent 
    {
        int Gold = 100;

        // How do i get the EntB class in the entis list from this class?
    }
    class EntB : Ent
    {
        float Position = 25.2f;
    }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ How can I check if any element of a list is in another list?
C#CC# / help
4y ago
How do i pass data from one form to another?
C#CC# / help
4y ago
❔ How do i call a method from another script
C#CC# / help
3y ago