diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-14 23:28:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-14 23:28:02 +0300 |
commit | c7f54151ba693e7f57378b77cc567d5aa26cf4cf (patch) | |
tree | 653165d368da9fc58c9dbb5a8161e4e420a0b37c /src/listeners | |
parent | c26624e72bb8d60bc1fa13cd5a178e06579e49a4 (diff) | |
download | ManaVerse-c7f54151ba693e7f57378b77cc567d5aa26cf4cf.tar.gz ManaVerse-c7f54151ba693e7f57378b77cc567d5aa26cf4cf.tar.bz2 ManaVerse-c7f54151ba693e7f57378b77cc567d5aa26cf4cf.tar.xz ManaVerse-c7f54151ba693e7f57378b77cc567d5aa26cf4cf.zip |
Enable publish button in personal buy shop only if it allowed by server.
Diffstat (limited to 'src/listeners')
-rw-r--r-- | src/listeners/buyingstoreslotslistener.cpp | 36 | ||||
-rw-r--r-- | src/listeners/buyingstoreslotslistener.h | 38 |
2 files changed, 74 insertions, 0 deletions
diff --git a/src/listeners/buyingstoreslotslistener.cpp b/src/listeners/buyingstoreslotslistener.cpp new file mode 100644 index 000000000..0ab1155df --- /dev/null +++ b/src/listeners/buyingstoreslotslistener.cpp @@ -0,0 +1,36 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "listeners/buyingstoreslotslistener.h" + +#include "debug.h" + +defineListener(BuyingStoreSlotsListener) + +void BuyingStoreSlotsListener::distributeEvent(const int slots) +{ + FOR_EACH (std::vector<BuyingStoreSlotsListener*>::iterator, + it, mListeners) + { + BuyingStoreSlotsListener *const listener = *it; + if (listener) + listener->buyingStoreSlotsChanged(slots); + } +} diff --git a/src/listeners/buyingstoreslotslistener.h b/src/listeners/buyingstoreslotslistener.h new file mode 100644 index 000000000..dc180a9cc --- /dev/null +++ b/src/listeners/buyingstoreslotslistener.h @@ -0,0 +1,38 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef LISTENERS_BUYINGSTORESLOTSLISTENER_H +#define LISTENERS_BUYINGSTORESLOTSLISTENER_H + +#include "listeners/baselistener.hpp" + +#include "localconsts.h" + +class BuyingStoreSlotsListener notfinal +{ + public: + virtual void buyingStoreSlotsChanged(const int slots) = 0; + + static void distributeEvent(const int slots); + + defineListenerHeader(BuyingStoreSlotsListener) +}; + +#endif // LISTENERS_BUYINGSTORESLOTSLISTENER_H |