qmlfrontend/team.cpp
author Wuzzy <Wuzzy2@mail.ru>
Sat, 20 Apr 2019 16:53:58 +0200
changeset 14829 f16868b40f2d
parent 14296 f1a5b7baa87f
permissions -rw-r--r--
Space Invasion: Fix possibility to go over shield limit with param

#include "team.h"

Hedgehog::Hedgehog()
    : name(QObject::tr("unnamed", "default hedgehog name").toUtf8()),
      hat("NoHat"),
      hp(100),
      level(0) {}

Team::Team()
    : name(QObject::tr("unnamed", "default team name").toUtf8()),
      color("12345678"),
      m_hedgehogsNumber(4) {
  m_hedgehogs.resize(8);
}

void Team::resize(int number) { m_hedgehogsNumber = number; }

QVector<Hedgehog> Team::hedgehogs() const {
  return m_hedgehogs.mid(0, m_hedgehogsNumber);
}