1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#include "main.h"
19
20#include "tile.h"
21#include "spawn.h"
22
23Spawns::Spawns() {
24 ////
25}
26
27Spawns::~Spawns() {
28 ////
29}
30
31void Spawns::addSpawn(Tile* tile) {
32 ASSERT(tile->spawn);
33
34 auto it = spawns.insert(tile->getPosition());
35 ASSERT(it.second);
36}
37
38void Spawns::removeSpawn(Tile* tile) {
39 ASSERT(tile->spawn);
40 spawns.erase(tile->getPosition());
41#if 0
42 SpawnPositionList::iterator iter = begin();
43 while(iter != end()) {
44 if(*iter == tile->getPosition()) {
45 spawns.erase(iter);
46 return;
47 }
48 ++iter;
49 }
50 ASSERT(false);
51#endif
52}
53
54std::ostream& operator<<(std::ostream& os, const Spawn& spawn) {
55 os << &spawn << ":: -> " << spawn.getSize() << std::endl;
56 return os;
57}
58