arrows can target players; card attachment works

This commit is contained in:
Max-Wilhelm Bruker 2010-07-17 18:24:14 +02:00
parent 61b82bd6f9
commit 614f106304
32 changed files with 885 additions and 402 deletions

View file

@ -27,6 +27,12 @@ Server_Card::Server_Card(QString _name, int _id, int _coord_x, int _coord_y)
Server_Card::~Server_Card()
{
// setParentCard(0) leads to the item being removed from our list, so we can't iterate properly
while (!attachedCards.isEmpty())
attachedCards.first()->setParentCard(0);
if (parentCard)
parentCard->removeAttachedCard(this);
}
void Server_Card::resetState()
@ -74,3 +80,12 @@ void Server_Card::setCounter(int id, int value)
else
counters.remove(id);
}
void Server_Card::setParentCard(Server_Card *_parentCard)
{
if (parentCard)
parentCard->removeAttachedCard(this);
parentCard = _parentCard;
if (parentCard)
parentCard->addAttachedCard(this);
}