![]() |
Edge Class ReferenceCommand: fill edge of chunk with terrain.
More...
|
Public Member Functions | |
Edge () | |
void | Execute (InSocket *, const std::string ¶ms, Parse &) |
Execute command. | |
std::string | Category () |
Get command category. | |
std::string | Description () |
Command description. |
Definition at line 28 of file Edge.h.
void Edge::Execute | ( | InSocket * | , | |
const std::string & | arg, | |||
Parse & | ||||
) | [virtual] |
Execute command.
Implements Command.
Definition at line 30 of file Edge.cpp.
References Player::GetArea(), and Player::GetChunk().
00031 { 00032 Database& db = from -> GetDatabase(); 00033 Player pl(db, from -> GetAccountName()); 00034 Area area(db, pl.GetArea()); 00035 Chunk chunk(db, area, pl.GetChunk()); 00036 std::string tstr = params; 00037 std::string widthstr = pa.getword(); 00038 if (tstr.size()) 00039 { 00040 Terrain t(db, area, tstr[0]); 00041 if (t.Exists()) 00042 { 00043 int width = widthstr.size() ? atoi(widthstr.c_str()) : 1; 00044 chunk.Edge(t, width); 00045 chunk.Save(); 00046 from -> Send("Ok.\n"); 00047 } 00048 else 00049 { 00050 from -> Send("Terrain?\n"); 00051 } 00052 } 00053 else 00054 { 00055 from -> Send("Usage: Edge <terrain char> <width (default 1)>\n"); 00056 } 00057 from -> SetPrompt(); 00058 }
std::string Edge::Category | ( | ) | [inline, virtual] |
std::string Edge::Description | ( | ) | [inline, virtual] |