10 classes inside a class, bad programing practices ?!

hay guys

What do you think of this code? Is it a good programing practice or bad? Should I program like this or will it make people confused?

thankx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

#include <SFML\Graphics.hpp>

class GameItems
{
public:

	sf::Image MediKit_Image;
	sf::Sprite MediKit_Sprite;

	class Weapons
	{
	public:

		class AssaultRifle
		{
		public:
			AssaultRifle();
			~AssaultRifle();

			void LoadFile();

		private:
			sf::Image Image;
			sf::Sprite Sprite;
		};

		class MachineGun
		{
		public:
			MachineGun();
			~MachineGun();

			void LoadFile();

		private:
			sf::Image Image;
			sf::Sprite Sprite;
		};

		class SMG
		{
		public:
			SMG();
			~SMG();

			void LoadFile();

		private:
			sf::Image Image;
			sf::Sprite Sprite;
		};

		class Rifle
		{
		public:
			Rifle();
			~Rifle();

			void LoadFile();

		private:
			sf::Image Image;
			sf::Sprite Sprite;
		};

		class Pistol
		{
		public:
			Pistol();
			~Pistol();

			void LoadFile();

		private:
			sf::Image Image;
			sf::Sprite Sprite;
		};

		class ShotGun
		{
		public:
			ShotGun();
			~ShotGun();

			void LoadFile();

		private:
			sf::Image Image;
			sf::Sprite Sprite;
		};
	};
};

You're misusing classes as namespaces here.
It is also doubtful that having all these classes provides any advantage, one for all is probably enough (although that depends on the details).
Topic archived. No new replies allowed.