How should I go about creating this "Factory"

I'm creating a game system and looking at the best way to implement it.

I have a bunch of classes and I want to create them in one class after looking at this in terms of a factory I don't think it's best suited. I'll give you an example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Sword : Weapon{
    int attackPower; 
    int weight;
    function A(){
        //...
    }

    function B(){
        //...
    }
}

class Pot : Container{
     int baseVolume; 
   
      function C(){
          //..
      }
}


I am looking for a way to create each of these classes from a single call, I was thinking a map<string, class> then be able to access them in a fast clean way, I just need some ideas to bounce off people.
Last edited on
Make a structure that has both classes and call that structure?
Maybe you use inheritance instead?
Last edited on
Topic archived. No new replies allowed.