~ubuntu-branches/ubuntu/saucy/kblocks/saucy-proposed

« back to all changes in this revision

Viewing changes to KBlocksPlayNetwork.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-12-07 17:39:13 UTC
  • Revision ID: package-import@ubuntu.com-20121207173913-5wqlq9suj93x4ap2
Tags: upstream-4.9.90
ImportĀ upstreamĀ versionĀ 4.9.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
*   KBlocks, a falling blocks game for KDE                                *
 
3
*   Copyright (C) 2010 Zhongjie Cai <squall.leonhart.cai@gmail.com>       *
 
4
*                                                                         *
 
5
*   This program is free software; you can redistribute it and/or modify  *
 
6
*   it under the terms of the GNU General Public License as published by  *
 
7
*   the Free Software Foundation; either version 2 of the License, or     *
 
8
*   (at your option) any later version.                                   *
 
9
***************************************************************************/
 
10
#ifndef KBLOCKSPLAYNETWORK_H
 
11
#define KBLOCKSPLAYNETWORK_H
 
12
 
 
13
#include "KBlocksGameLogic.h"
 
14
#include "GamePlayerInterface.h"
 
15
#include "KBlocksNetPlayer.h"
 
16
 
 
17
class KBlocksPlayNetwork
 
18
{
 
19
    public:
 
20
        KBlocksPlayNetwork(int capacity, const string& serverIP, int localPort);
 
21
        ~KBlocksPlayNetwork();
 
22
        
 
23
    public:
 
24
        bool addGamePlayer(GamePlayerInterface * p);
 
25
        void clearGamePlayer();
 
26
        
 
27
        void startGame();
 
28
        void stopGame();
 
29
        
 
30
        int  execute();
 
31
        
 
32
        void cancelExecute();
 
33
        
 
34
    private:
 
35
        string mServerIP;
 
36
        int mLocalPort;
 
37
        
 
38
        bool mRunning;
 
39
        
 
40
        int mPlayerCount;
 
41
        int mMaxCapacity;
 
42
        KBlocksNetPlayer** maPlayerList;
 
43
        
 
44
        KBlocksGameLogic* mpGameLogic;
 
45
};
 
46
 
 
47
#endif
 
48