Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Client|Server: Added a shared base class for Doomsday applications
For now this will own the players array.
  • Loading branch information
skyjake committed Jul 4, 2015
1 parent 66200e4 commit 926d7a3
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doomsday/apps/client/include/clientapp.h
Expand Up @@ -21,6 +21,7 @@
#define CLIENTAPP_H

#include <de/BaseGuiApp>
#include <doomsday/doomsdayapp.h>

#include "settingsregister.h"
#include "network/serverlink.h"
Expand All @@ -36,7 +37,7 @@
/**
* The client application.
*/
class ClientApp : public de::BaseGuiApp
class ClientApp : public de::BaseGuiApp, public DoomsdayApp
{
Q_OBJECT

Expand Down
36 changes: 36 additions & 0 deletions doomsday/apps/libdoomsday/include/doomsday/doomsdayapp.h
@@ -0,0 +1,36 @@
/** @file doomsdayapp.h Common application-level state and components.
*
* @authors Copyright (c) 2015 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>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, see:
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBDOOMSDAY_DOOMSDAYAPP_H
#define LIBDOOMSDAY_DOOMSDAYAPP_H

#include "libdoomsday.h"

/**
* Common application-level state and components.
*
* Both the server and client applications have an instance of DoomsdayApp
* to manage the common state and subsystems.
*/
class LIBDOOMSDAY_PUBLIC DoomsdayApp
{
public:
DoomsdayApp();
};

#endif // LIBDOOMSDAY_DOOMSDAYAPP_H
23 changes: 23 additions & 0 deletions doomsday/apps/libdoomsday/src/doomsdayapp.cpp
@@ -0,0 +1,23 @@
/** @file doomsdayapp.cpp Common application-level state and components.
*
* @authors Copyright (c) 2015 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>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, see:
* http://www.gnu.org/licenses</small>
*/

#include "doomsday/doomsdayapp.h"

DoomsdayApp::DoomsdayApp()
{}

3 changes: 2 additions & 1 deletion doomsday/apps/server/include/serverapp.h
Expand Up @@ -21,6 +21,7 @@
#define SERVERAPP_H

#include <de/TextApp>
#include <doomsday/doomsdayapp.h>
#include "serversystem.h"
#include "ui/infine/infinesystem.h"
#include "resource/resourcesystem.h"
Expand All @@ -30,7 +31,7 @@
/**
* The server application.
*/
class ServerApp : public de::TextApp
class ServerApp : public de::TextApp, public DoomsdayApp
{
public:
ServerApp(int &argc, char **argv);
Expand Down

0 comments on commit 926d7a3

Please sign in to comment.