00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <libfuture.h>
00021
00022 #include "Portal.h"
00023 #include "Player.h"
00024 #include "InSocket.h"
00025
00026
00027 Portal::Portal(Database& db,Chunk& chunk) : Chunkinfo(db, chunk)
00028 {
00029 }
00030
00031
00032 Portal::Portal(Database& db,Chunk& chunk,int x,int y) : Chunkinfo(db, chunk, x, y, TYPE_PORTAL)
00033 {
00034 }
00035
00036
00037 Portal::~Portal()
00038 {
00039 }
00040
00041
00042 void Portal::SetToArea(int x)
00043 {
00044 m_chunkinfo -> to_area = x;
00045 }
00046
00047
00048 void Portal::SetToChunk(int x)
00049 {
00050 m_chunkinfo -> to_chunk = x;
00051 }
00052
00053
00054 void Portal::SetToX(int x)
00055 {
00056 m_chunkinfo -> to_x = x;
00057 }
00058
00059
00060 void Portal::SetToY(int x)
00061 {
00062 m_chunkinfo -> to_y = x;
00063 }
00064
00065
00066 int Portal::GetToArea()
00067 {
00068 return m_chunkinfo -> to_area;
00069 }
00070
00071
00072 int Portal::GetToChunk()
00073 {
00074 return m_chunkinfo -> to_chunk;
00075 }
00076
00077
00078 int Portal::GetToX()
00079 {
00080 return m_chunkinfo -> to_x;
00081 }
00082
00083
00084 int Portal::GetToY()
00085 {
00086 return m_chunkinfo -> to_y;
00087 }
00088
00089
00090 void Portal::Display(InSocket *from)
00091 {
00092 if (!Exists())
00093 return;
00094 Player pl(from -> GetDatabase(),from -> GetAccountName());
00095 from -> Send(" You see a portal.\n");
00096 if (pl.IsWizard())
00097 {
00098 from -> Sendf(" [&gToArea:&W%ld&n &gToChunk:&W%ld&n &gToX:&W%d&n &gToY:&W%d&n]\n",
00099 GetToArea(), GetToChunk(), GetToX(), GetToY());
00100 }
00101 }
00102
00103