⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cardcolappl.cpp

📁 一个扑克牌游戏集合的源码,包含了很多基本c-c++语言应用
💻 CPP
字号:
//$Id: CardColAppl.cpp,v 1.14 2006/08/07 01:14:23 markus Rel $//PROJECT     : Cardgames//SUBSYSTEM   : Console-Application//REFERENCES  ://TODO        ://BUGS        ://REVISION    : $Revision: 1.14 $//AUTHOR      : Markus Schwab//CREATED     : 7.7.2005//COPYRIGHT   : Copyright (C) 2005, 2006// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.#include <cardgames-cfg.h>#include <cstdio>#include <YGP/File.h>#include <YGP/Check.h>#include <YGP/Trace.h>#include <YGP/INIFile.h>#include <XGP/XAttribute.h>#include <Player.h>#ifdef WITH_BURACO#  include "Buraco.h"#  include "BuracoCards.h"#endif#ifdef WITH_HEARTS#  include "Hearts.h"#endif#ifdef WITH_ROVHULT#  include "Rovhult.h"#  include "CardValue.h"#endif#ifdef WITH_SGTMAYOR#  include "SgtMayor.h"#endif#include "GameTypes.h"#include "CardColAppl.h"const YGP::IVIOApplication::longOptions CardgameAppl::lo[] = {   { IVIOAPPL_HELP_OPTION },   { "game", 'g' },   { "browser", 'b' },   { "dir-help", 'd' },   { "file", 'f' },   { "list-games", 'G' },#ifdef HAVE_LIBPTHREAD   { "listen-at", 'l' },   { "connect-to", 'c' },#endif   { "version", 'V' },#ifdef SAVE_GAME   { "save-game", 'S' },   { "load-game", 'L' },#endif   { NULL, '\0' } };#ifdef HAVE_LIBPTHREADconst unsigned int CardgameAppl::PORT (DEFPORT);#endif//-----------------------------------------------------------------------------/// Displays the help//-----------------------------------------------------------------------------void CardgameAppl::showHelp () const {   std::cout << _("Collection of cardgames\n\nUsage: ") << PACKAGE             << _(" [OPTIONS]\n\n")      /* For translations: Write the Rovhult as o-slash */             << "  -g, --game ......... " << _("[GAME] Select game to start (default: Rovhult)\n")             << "  -G, --list-games ... " << _("List available games\n")             << "  -f, --file ......... " << _("[FILE] Use file as INI file\n")             << "  -b, --browser ...... " << _("[NAME] Browser to use to display the help\n")             << "  -d, --dir-help ..... " << _("[DIR] Directory to search for help\n")#ifdef HAVE_LIBPTHREAD             << "  -l, --listen-at .... " << _("[PORT] Awaits connections on port PORT\n")             << "  -c, --connect-to ... " << _("[SERVER[:PORT]] Connects to SERVER:PORT\n")#endif#ifdef SAVE_GAME             << "  -S, --save-game .... " << _("[FILE] Saves game into FILE\n")             << "  -L, --load-game .... " << _("[FILE] Load game from FILE\n")#endif             << "  -V, --version ...... " << _("Output version information and exit\n")             << "  -h, -?, --help ..... " << _("Displays this help and exit\n\n")      /* For translations: Write one of the Rovhults as an O with slash */             << _("Valid values for GAME are - unless disabled while configuring - Buraco, Hearts,\n"		  "Machiavelli, Rovhult, SgtMayor, Twopart and the numbers 0 - 5 (corresponding\n"		  "to the games in the above order) or the translation of the name (as displayed\n"		  "below).\n\n");   showGames ();   std::cout << _("\nThe INI file can have the following entries:\n\n")             <<  "  [Game]\n"                 "  Type=Twopart\n"                 "  Helpbrowser=galeon\n"                 "  Helpdir=/usr/share/doc/Cardgames/\n"                 "  CardFront=/usr/share/carddecks/cards-default/\n"                 "  CardBack=/usr/share/carddecks/decks/deck1.png\n\n"                 "  [Player]\n"                 "  0=Human\n"                 "  1=Computer 1\n"                 "  2=Computer 2\n"                 "  3=Computer 3\n";}//-----------------------------------------------------------------------------/// Checks the validity of the passed option/// \param option: Actual option/// \returns \c bool: Status; false: Invalid option/option-value Require :///     option not '\0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -