![]() |
Left Class ReferenceCommand: turn left.
More...
|
Public Member Functions | |
Left () | |
void | Execute (InSocket *, const std::string ¶ms, Parse &) |
Execute command. | |
std::string | Category () |
Get command category. |
Definition at line 28 of file Left.h.
void Left::Execute | ( | InSocket * | , | |
const std::string & | arg, | |||
Parse & | ||||
) | [virtual] |
Execute command.
Implements Command.
Definition at line 26 of file Left.cpp.
References Player::GetFacing(), Look::LookMap(), and Player::SetFacing().
00027 { 00028 Player pl(from -> GetDatabase(),from -> GetAccountName()); 00029 if (!pl.GetFacing()) 00030 pl.SetFacing(1); 00031 switch (pl.GetFacing()) 00032 { 00033 case 1: // north 00034 pl.SetFacing(4); 00035 break; 00036 case 2: // south 00037 pl.SetFacing(3); 00038 break; 00039 case 3: // east 00040 pl.SetFacing(1); 00041 break; 00042 case 4: // west 00043 pl.SetFacing(2); 00044 break; 00045 } 00046 Look::LookMap(from); 00047 from -> SetPrompt(); 00048 }
std::string Left::Category | ( | ) | [inline, virtual] |