I did it in some other way that solved the problem but now I need to remake it in this - correct way. also there must not be option for calling "resources" and getting different names, they all must be exactly same in every unit/building/player script which works with resources. There is an easy workaround, but it is somewhat tedious. When I call "new Sapling()" I'll get these fields without 'manually' adding them after making new SaplingĮxact problem I had when I was making ingame resources (gold, wood, stone.) I wanted them to be in same Array but they need name, value, icon. it was incorrect, because C++ does not let you reassign array values. My problem was - I wanted to preset these 6 fields every time "Sapling" is called with no other possible field options. If you want use std::initializerlist after initialization: auto init std::initializerlistyou! You helped me with my a little bit more complex question with custom class array Here it is for others who are seeking same or similar answer: public class Sapling Initializer lists are just usable during initialization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |