- reworked completly the JNetwork, JSocket interface (had to ifdef out the PSP socket code)
- added 2 menus to wait for connection and wait for deck selection - tested compilation on Qt Linux, Qt Windows and PSP - deactivated everywhere (NETWORK_SUPPORT to activate).
This commit is contained in:
@@ -5,9 +5,16 @@
|
||||
#include "DeckStats.h"
|
||||
#include "ManaCost.h"
|
||||
|
||||
Player::Player(MTGDeck * deck, string file, string fileSmall) :
|
||||
Player::Player(string file, string fileSmall, MTGDeck * deck) :
|
||||
Damageable(20)
|
||||
{
|
||||
bool deleteDeckPlease = false;
|
||||
if(deck == NULL && file != "testsuite" && file != "remote")
|
||||
{
|
||||
deck = NEW MTGDeck(file.c_str(), MTGCollection());
|
||||
deleteDeckPlease = true;
|
||||
}
|
||||
|
||||
game = NULL;
|
||||
deckFile = file;
|
||||
deckFileSmall = fileSmall;
|
||||
@@ -25,6 +32,10 @@ Damageable(20)
|
||||
game->setOwner(this);
|
||||
deckName = deck->meta_name;
|
||||
}
|
||||
if(deleteDeckPlease)
|
||||
{
|
||||
SAFE_DELETE(deck);
|
||||
}
|
||||
}
|
||||
|
||||
/*Method to call at the end of a game, before all objects involved in the game are destroyed */
|
||||
@@ -87,8 +98,8 @@ Player * Player::opponent()
|
||||
return this == game->players[0] ? game->players[1] : game->players[0];
|
||||
}
|
||||
|
||||
HumanPlayer::HumanPlayer(MTGDeck * deck, string file, string fileSmall) :
|
||||
Player(deck, file, fileSmall)
|
||||
HumanPlayer::HumanPlayer(string file, string fileSmall, MTGDeck * deck) :
|
||||
Player(file, fileSmall, deck)
|
||||
{
|
||||
loadAvatar("avatar.jpg");
|
||||
playMode = MODE_HUMAN;
|
||||
@@ -203,6 +214,7 @@ istream& operator>>(istream& in, Player& p)
|
||||
}
|
||||
|
||||
in >> *(p.game);
|
||||
p.game->setOwner(&p);
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user