Exemplo n.º 1
0
MobileDive::MobileDive(dive *d)
{
	m_thisDive = d;
	setDiveNumber(QString::number(d->number));
	setDiveId(QString::number(d->id));

	dive_trip *trip = d->divetrip;

	if(trip) {
		//trip is valid
		setTrip(trip->location);
	}

	setDate(get_dive_date_string(d->when));
	setDepth(get_depth_string(d->maxdepth));
	setDuration(get_dive_duration_string(d->duration.seconds, "h:","min"));

	setupDiveTempDetails();

	weight_t tw = { total_weight(d) };
	setWeight(weight_string(tw.grams));

	setSuit(QString(d->suit));
	setCylinder(QString(d->cylinder[0].type.description));
	setSac(QString::number(d->sac));
	setLocation(get_dive_location(d));
	setNotes(d->notes);
	setBuddy(d->buddy);
	setDivemaster(d->divemaster);
}
Exemplo n.º 2
0
Card &Card::operator=(const Card &c)
// assignment operator overload
{
    setValue(c.getValue());
    setSuit(c.getSuit());
    return *this;
}
Exemplo n.º 3
0
Card::Card(const Card &card)
// copy constructor which takes the values out of the given card and copies
// them into this Card
{
    setValue(card.getValue());
    setSuit(card.getSuit());
}
Exemplo n.º 4
0
// constructor
// initialize card to a reasonable value.
// the card is initially not visible to any player at the table.
CCard::CCard(void)
{
	setFrontTexture(NULL);
	setBackTexture(NULL);
	setRank(Ace);
	setSuit(Hearts);
	// for debug - set to true
	setFaceUp(false);
	setSpriteLength(0);
	setSpriteWidth(0);
	setLocation(0, 0);
	setFileName(L"");

	return;
}
void WrappedCard::takeOver(Card *card)
{
    Q_ASSERT(getId() >= 0);
    Q_ASSERT(card != this);
    Q_ASSERT(m_card != card);
    if (m_card != NULL) {
        m_isModified = true;
        delete m_card;
    }
    m_card = card;
    m_card->setId(getId());
    setObjectName(card->objectName());
    setSuit(card->getSuit());
    setNumber(card->getNumber());
    m_skillName = card->getSkillName(false);
}
Exemplo n.º 6
0
Card::Card(const int val, const Suit s)
// simple Card constructor
{
    setValue(val);
    setSuit(s);
}