mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
initial commit
This commit is contained in:
commit
a11f93df4d
99 changed files with 7493 additions and 0 deletions
55
servatrice/src/playerzone.h
Normal file
55
servatrice/src/playerzone.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2008 by Max-Wilhelm Bruker *
|
||||
* brukie@laptop *
|
||||
* *
|
||||
* 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. *
|
||||
***************************************************************************/
|
||||
#ifndef PLAYERZONE_H
|
||||
#define PLAYERZONE_H
|
||||
|
||||
#include <QList>
|
||||
#include "testcard.h"
|
||||
#include "testrandom.h"
|
||||
|
||||
class PlayerZone {
|
||||
private:
|
||||
QString name;
|
||||
bool has_coords;
|
||||
bool is_public; // Contents of the zone are visible for anyone
|
||||
bool id_access; // getCard() finds by id, not by list index
|
||||
// Example: When moving a card from the library to the table,
|
||||
// the card has to be found by list index because the client
|
||||
// does not know the id. But when moving a card from the hand
|
||||
// to the table, the card can be found by id because the client
|
||||
// knows the id and the hand does not need to have a specific order.
|
||||
public:
|
||||
PlayerZone(QString _name, bool _has_coords, bool _is_public, bool _id_access);
|
||||
~PlayerZone();
|
||||
|
||||
TestCard *getCard(int id, bool remove, int *position = NULL);
|
||||
|
||||
bool isPublic() { return is_public; }
|
||||
bool hasCoords() { return has_coords; }
|
||||
bool hasIdAccess() { return id_access; }
|
||||
QString getName() { return name; }
|
||||
|
||||
QList<TestCard *> cards;
|
||||
void insertCard(TestCard *card, int x, int y);
|
||||
void shuffle(TestRandom *rnd);
|
||||
void clear();
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue