Logo
~Sockets~
~Examples~
~Contact~

Edge Class Reference
[Commands]

Command: fill edge of chunk with terrain. More...

#include <Edge.h>

Inheritance diagram for Edge:

Inheritance graph
[legend]
Collaboration diagram for Edge:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Edge ()
void Execute (InSocket *, const std::string &params, Parse &)
 Execute command.
std::string Category ()
 Get command category.
std::string Description ()
 Command description.

Detailed Description

Command: fill edge of chunk with terrain.

Definition at line 28 of file Edge.h.


Constructor & Destructor Documentation

Edge::Edge (  )  [inline]

Definition at line 31 of file Edge.h.

00031 : Command("edge", true) {}


Member Function Documentation

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]

Get command category.

Implements Command.

Definition at line 35 of file Edge.h.

00035 { return "Editing"; }

std::string Edge::Description (  )  [inline, virtual]

Command description.

Reimplemented from Command.

Definition at line 36 of file Edge.h.

00036 { return "Fill edge of chunk with terrain"; }


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