Assemberist / cppRpg

0 stars 0 forks source link

Menu containment improvement #23

Closed Assemberist closed 1 year ago

Assemberist commented 1 year ago

There is several types of menu class. They handle different data types by different ways. As mentioned in #17 menu class can be changed to template class. Or handling of different classes can be moved from classes. I guess second way is better because new state is planned for observation mode and it can require to handle menu as associated array.

New structure can use more memory or actions because it is interface.

Assemberist commented 1 year ago

As mentioned in https://github.com/Assemberist/cppRpg/issues/17 menu class can be changed to template class.

That has been done.

Or handling of different classes can be moved from classes.

I mean that several print() functions can be implemented for one class, but it looks bad and the logic is complicate. Also this variant was discarded due to one type of elements require only one print().

Class text_field should not use game-related classes. So new file created that use as text_filed as game classes. Class menu rewritten as templated. And it is abstract base class for all menus.

Assemberist commented 1 year ago

Wrong id was in last 2-3 commits. It should be #19.