munificent / game-programming-patterns

Source repo for the book
http://gameprogrammingpatterns.com/
Other
4.12k stars 498 forks source link

Type Object: Making type objects more like types: constructors #376

Closed justsowoo closed 1 year ago

justsowoo commented 1 year ago

Hi, I found that Monster class's constructor is changed from public to private. In this case, how to new a Monster class and pass the parameter "someBreed" into it? Maybe the Monster class's constructor should be public? Monster* monster = someBreed.newMonster();

1
justsowoo commented 1 year ago

Sorry, My bad! I didn't know the friend classes feature in C++. And I found the Notes besides it.