libkdegames/kggzmod
request.cpp
Go to the documentation of this file.00001 /* 00002 This file is part of the kggzmod library. 00003 Copyright (c) 2005 - 2007 Josef Spillner <josef@ggzgamingzone.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #include "request.h" 00022 00023 using namespace KGGZMod; 00024 00025 Request::Request(Type type) 00026 { 00027 m_type = type; 00028 } 00029 00030 Request::Type Request::type() const 00031 { 00032 return m_type; 00033 } 00034 00035 StateRequest::StateRequest(/*Module::State*/int state) 00036 : Request(Request::state) 00037 { 00038 data["state"] = QString::number(state); 00039 } 00040 00041 StandRequest::StandRequest() 00042 : Request(Request::stand) 00043 { 00044 } 00045 00046 SitRequest::SitRequest(int seat) 00047 : Request(Request::sit) 00048 { 00049 data["seat"] = QString::number(seat); 00050 } 00051 00052 BootRequest::BootRequest(const QString &playername) 00053 : Request(Request::boot) 00054 { 00055 data["player"] = playername; 00056 } 00057 00058 BotRequest::BotRequest(int seat) 00059 : Request(Request::bot) 00060 { 00061 data["seat"] = QString::number(seat); 00062 } 00063 00064 OpenRequest::OpenRequest(int seat) 00065 : Request(Request::open) 00066 { 00067 data["seat"] = QString::number(seat); 00068 } 00069 00070 ChatRequest::ChatRequest(const QString &message) 00071 : Request(Request::chat) 00072 { 00073 data["message"] = message; 00074 } 00075 00076 InfoRequest::InfoRequest(int seat) 00077 : Request(Request::info) 00078 { 00079 data["seat"] = QString::number(seat); 00080 } 00081 00082 InfoRequest::InfoRequest() 00083 : Request(Request::info) 00084 { 00085 data["seat"] = QString::number(-1); 00086 } 00087 00088 RankingsRequest::RankingsRequest() 00089 : Request(Request::rankings) 00090 { 00091 } 00092
KDE 4.2 API Reference