I am building a game and have several groups of namespaces. One is called “Engine” the other called “Game”. There are several functions and variables that I only want Engine to be able to see. What do I need to do to hide certain functions (not whole classes) from the Game namespace.
Share
C# doesn’t have any access modifiers which refer to namespaces.
Instead, perhaps you should put your types into different assemblies – then use the
internalaccess modifier to limit access to the assembly in which a type or member is declared.Additionally, if you want a type which is only relevant to one other type, you can nest it and make it private: