Sorted Socket.
[UnsignedByte.git] / src / DB / Savables / Exit.h
blob8c0a901e4f41efba440347ceb2ece1b3e91cfb56
1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #pragma once
22 #include "SavableHeaders.h"
23 #include "SavableTypes.h"
24 #include "Coordinate.h"
26 namespace mud
28 class ExitManager;
30 class Exit : public Savable
32 public:
34 * Getters
36 value_type getFromChunk() const;
37 value_type getToChunk() const;
38 Coordinate getDirection() const;
41 * Setters
43 void setFromChunk(value_type room);
44 void setToChunk(value_type room);
45 void setDirection(const Coordinate& direction);
48 * Utilities
50 SavableManagerPtr getManager() const;
51 TableImplPtr getTable() const;
54 * Database operations
56 void Delete();
57 void Save();
58 void Discard();
59 bool Exists();
61 private:
62 friend class mud::ExitManager; // For constructor
63 friend SmartPtrDelete(mud::Exit);
65 SavableManagerPtr m_exit;
67 /**
68 * Constructor
69 * @param exit The DB object
71 Exit(SavableManagerPtr exit);
73 Exit(const Exit& rhs);
74 Exit operator=(const Exit& rhs);
76 /** Destructor, unlocks the savable. */
77 ~Exit(void);