Logo
~Sockets~
~Examples~
~Contact~

Left Class Reference
[Commands]

Command: turn left. More...

#include <Left.h>

Inheritance diagram for Left:

Inheritance graph
[legend]
Collaboration diagram for Left:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Left ()
void Execute (InSocket *, const std::string &params, Parse &)
 Execute command.
std::string Category ()
 Get command category.

Detailed Description

Command: turn left.

Definition at line 28 of file Left.h.


Constructor & Destructor Documentation

Left::Left (  )  [inline]

Definition at line 31 of file Left.h.

00031 : Command("left", 'x') {}


Member Function Documentation

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]

Get command category.

Implements Command.

Definition at line 35 of file Left.h.

00035 { return "Navigation"; }


The documentation for this class was generated from the following files:
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4