3 * Riven-Wahrk - a reimplementation of the game Riven, by Cyan
4 * Copyright (C) 2009-2010 Tyler Genter <tylergenter@gmail.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 using namespace riven
;
27 static std::vector
<card_t
*> old_cards
;
28 card_t
*card_t::current
;
31 card_t::card_t (int idIn
) :
32 file_t (resource_t::CARD
, idIn
),
39 std::cout
<< "opening new card " << id
<< "\n";
43 script
.run_handler (handler_t::CardLoad
);
44 script
.run_handler (handler_t::DisplayUpdate
);
45 script
.run_handler (handler_t::CardOpen
);
46 hotspot
.mouseMove (game::mouseCoor
.x
, game::mouseCoor
.y
);
50 void card_t::close () {
51 std::cout
<< "closing card\n";
52 script
.run_handler (handler_t::CardClose
);
53 old_cards
.push_back (this);
56 void card_t::deleteOldCards () {
58 std::vector
<card_t
*>::iterator iter
= old_cards
.begin();
59 while (iter
!= old_cards
.end()) {
62 iter
= old_cards
.erase (iter
);