enum MenuResult
{
Nothing, // Enums for game state
Exit, // Enums for game state
Play, // Enums for game state
};
MenuResult Show(sf::RenderWindow& window)
Im not really sure why the Show has a parameter. I mean its an enum.
Doesnt that suppose to be
MenuResult Show = MenuResult.Nothing; ?
Why does the show has a parameter? It just doesnt make any sense. I tried searching it on google and I cant seem to find this kind of application of enum.
Can some explain me why is this? I dont see the connection of the parameter to the enum MenuResult
Show is a function, taking reference to RenderWindow as a parameter (most likely a window to show) and returning a MenuResult value (no idea what for).
Coming from c# this is kinda weird to look at really.
SO in other words the parameter sf::RenderWindow window has nothing to do with the return type itself? It just takes the parameter and do something about it and just return an enum?
Its really weird. First time seeing this kind of enum application.
SO in other words the parameter sf::RenderWindow window has nothing to do with the return type itself? It just takes the parameter and do something about it and just return an enum?
Yes, that's correct. That function declaration has exactly the same syntax as any other function declaration: