![]() |
Clear Class ReferenceCommand: clear chunk from terrain.
More...
|
Public Member Functions | |
Clear () | |
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 Clear.h.
void Clear::Execute | ( | InSocket * | , | |
const std::string & | arg, | |||
Parse & | ||||
) | [virtual] |
Execute command.
Implements Command.
Definition at line 27 of file Clear.cpp.
References Player::GetArea(), Player::GetChunk(), Player::GetChunkX(), and Player::GetChunkY().
00028 { 00029 Database& db = from -> GetDatabase(); 00030 Player pl(db, from -> GetAccountName()); 00031 Area area(db, pl.GetArea()); 00032 Chunk chunk(db, area, pl.GetChunk()); 00033 00034 char fromchar = chunk.Get(pl.GetChunkX(),pl.GetChunkY()); 00035 if (' ' != fromchar) 00036 { 00037 chunk.Fill(pl.GetChunkX(),pl.GetChunkY(),fromchar,' '); 00038 chunk.Save(); 00039 from -> Send("Ok.\n"); 00040 } 00041 else 00042 { 00043 from -> Send("Can't fill with same terrain.\n"); 00044 } 00045 from -> SetPrompt(); 00046 }
std::string Clear::Category | ( | ) | [inline, virtual] |
std::string Clear::Description | ( | ) | [inline, virtual] |