fix agentOnCamera to cope with the wrap
[openc2e.git] / MetaRoom.h
blob2be8f1f107482fa47cd5cdb289bd5df3ce251c69
1 /*
2 * MetaRoom.h
3 * openc2e
5 * Created by Alyssa Milburn on Tue May 25 2004.
6 * Copyright (c) 2004 Alyssa Milburn. All rights reserved.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
20 #ifndef _C2E_METAROOM_H
21 #define _C2E_METAROOM_H
23 #include "openc2e.h"
24 #include <string>
25 #include <vector>
26 #include <map>
28 class creaturesImage;
30 class MetaRoom {
31 protected:
32 FRIEND_SERIALIZE(MetaRoom);
33 unsigned int xloc, yloc, wid, hei, fullwid, fullhei;
34 std::map<std::string, shared_ptr<creaturesImage> > backgrounds;
35 shared_ptr<creaturesImage> firstback;
36 bool wraps;
38 MetaRoom() { }
40 public:
41 std::vector<shared_ptr<class Room> > rooms;
43 unsigned int x() { return xloc; }
44 unsigned int y() { return yloc; }
45 unsigned int width() { return wid; }
46 unsigned int height() { return hei; }
47 unsigned int fullwidth() { return fullwid; }
48 unsigned int fullheight() { return fullhei; }
49 bool wraparound() { return wraps; }
50 void setWraparound(bool w) { wraps = !!w; }
52 unsigned int addRoom(shared_ptr<class Room>);
53 void addBackground(std::string, shared_ptr<creaturesImage> = shared_ptr<creaturesImage>());
54 shared_ptr<creaturesImage> getBackground(std::string);
55 std::vector<std::string> backgroundList();
57 shared_ptr<Room> nextFloorFromPoint(float x, float y);
59 shared_ptr<Room> roomAt(float x, float y);
60 std::vector<shared_ptr<Room> > roomsAt(float x, float y);
62 unsigned int id;
64 MetaRoom(int _x, int _y, int width, int height, const std::string &back, shared_ptr<creaturesImage> = shared_ptr<creaturesImage>(), bool wrap = false);
65 ~MetaRoom();
68 #endif
69 /* vim: set noet: */