[C#] Namespaces

Associate
Joined
1 Feb 2006
Posts
1,868
Location
Reading
I need some help understanding how to utilise namespaces.

I'm doing a project to make a poker AI.

I have a solution called Poker.

I have a project called Engine. This is the game exe

I then have multiple projects for each type of AI I make which compile to assemblies.


Ideally I want them all to be under the same namespace "Poker" so they can all use the same types etc. E.G. Poker.Engine for all types and classes to do with the game engine and Poker.AI for all AI classes.

Can namespaces span multiple projects?

Is it possible to set it up how I want? I initially tried setting the namespace for each project to "Poker" which didn't work!

Any help appreciated
 
Last edited:
Thanks gents.

Had a little play around and basically I was confusing namespaces and references. I thought If I kept everything under one solution and namespace all projects could share their classes/types. But of course you have to reference the projects with each other but that caused circular references.

So just had to rejig my class structure to get around the circular references.

:)
 
Back
Top Bottom