Hey,

I'm working on a chess game, and I'm creating two enumerations - for piece_color and piece_type. I'm wondering what the difference is (whether it's an actual difference in the way the program executes or a matter of good object-oriented practice) between having the enums be global or having them as public members of a piece class.

Thanks.

It depends on where you want the names visible and how you address them: that is, your preference.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.