Im trying to use an enum as a parameter in order to tell my render function what kind of content should be rendered.
My Problem is now, that no matter what I give as a parameter, gcc just reports an error by saying:
Quote:ScreenObjectsContainer.hpp:28: error: variable or field `render' declared void
Here is the code:
#ifndef SCREENOBJECTSCONTAINER_HPP
#define SCREENOBJECTSCONTAINER_HPP
#include <iostream>
#include <list>
#include "ScreenObject.hpp"
using namespace std;
namespace client
{
class Client;
class GraphicModule;
class ScreenObjectsContainer
{
typedef list<ScreenObject*> Screen_List;
public:
ScreenObjectsContainer (Client *new_client, GraphicModule *new_graphic_module);
~ScreenObjectsContainer ();
void register_item (ScreenObject *new_scr_object);
void remove_item (ScreenObject *scr_object, int x_pos, int y_pos);
void fire_action (int x_pos, int y_pos);
void arm_item (int x_pos, int y_pos);
void render (client::GraphicModule::module_state new_state); //HERE is the enum as a parameter
private:
GraphicModule *module;
Client *client;
int screen_width;
int screen_height;
bool system_highlighted;
Screen_List curr_list;
};
}
#endif
The funny thing is that before I implemented the function, gcc gave me this as an error:
Quote:GraphicModule.cpp:149: error: no matching function for call to `client::ScreenObjectsContainer::render(client::GraphicModule::module_state)'
I guess this is caused by the namespace or the forward declarations, but I got no idea how to fix this, so can anybody help me out?