void Game::addItem(u16 itemId, u16 quantity, WINDOW_TYPE window)
{
if (window == INVENTORY_WINDOW)
{
inventoryWindow->getItemWindow()->addItem(itemId, quantity);
}
else
{
guienv->addMessageBox(L"Server Error", L"The server attempted to send an item to an invalid window.");
}
}
Now my question is would it be a better idea to have all windows extend a Window class and this window class has a virtual void called addItem. Not all windows are going to be able to add items to them so I suppose my original idea was better. Or maybe a better idea again would be to have a window class and then a getTypes function and it will return a char explaining what the object is capable of doing.
That way you could just do something bitwize like this