git repos / blockattack-game

source/code/menu/MenuItemCommand.cpp

browsing at commit = 1a156b60ed5a5665c18f06dc9e0a5ef1a5c08de9

raw · blame · history

/*
 * File:   MenuItemCommand.cpp
 * Author: poul
 *
 * Created on 11. marts 2011, 20:46
 */

#include "MenuItemCommand.hpp"

MenuItemCommand::MenuItemCommand()
{
	selected = false;
}

MenuItemCommand::MenuItemCommand(string text, void(*pt2Function)() )
{
	this->text = text;
	command = pt2Function;
	selected = false;
}

MenuItemCommand::MenuItemCommand(const MenuItemCommand& orig)
{
}

MenuItemCommand::~MenuItemCommand()
{
}

void MenuItemCommand::SetSelected(bool selected)
{
	this->selected = selected;
}

void MenuItemCommand::Activated()
{
	//Add execode
	command();
}

string MenuItemCommand::GetType()
{
	return "MenuItemCommand";
}

string MenuItemCommand::GetText()
{
	return text;
}

void MenuItemCommand::SetText(string text)
{
	this->text = text;
}