qmlfrontend/team.cpp
changeset 14312 f1a5b7baa87f
parent 14164 745c73e0e644
equal deleted inserted replaced
14311:92e5682810d4 14312:f1a5b7baa87f
     1 #include "team.h"
     1 #include "team.h"
     2 
     2 
     3 Hedgehog::Hedgehog()
     3 Hedgehog::Hedgehog()
     4     : name(QObject::tr("unnamed", "default hedgehog name").toUtf8())
     4     : name(QObject::tr("unnamed", "default hedgehog name").toUtf8()),
     5     , hat("NoHat")
     5       hat("NoHat"),
     6     , hp(100)
     6       hp(100),
     7     , level(0)
     7       level(0) {}
     8 {
     8 
       
     9 Team::Team()
       
    10     : name(QObject::tr("unnamed", "default team name").toUtf8()),
       
    11       color("12345678"),
       
    12       m_hedgehogsNumber(4) {
       
    13   m_hedgehogs.resize(8);
     9 }
    14 }
    10 
    15 
    11 Team::Team()
    16 void Team::resize(int number) { m_hedgehogsNumber = number; }
    12     : name(QObject::tr("unnamed", "default team name").toUtf8())
    17 
    13     , color("12345678")
    18 QVector<Hedgehog> Team::hedgehogs() const {
    14     , m_hedgehogsNumber(4)
    19   return m_hedgehogs.mid(0, m_hedgehogsNumber);
    15 {
       
    16     m_hedgehogs.resize(8);
       
    17 }
    20 }
    18 
       
    19 void Team::resize(int number)
       
    20 {
       
    21     m_hedgehogsNumber = number;
       
    22 }
       
    23 
       
    24 QVector<Hedgehog> Team::hedgehogs() const
       
    25 {
       
    26     return m_hedgehogs.mid(0, m_hedgehogsNumber);
       
    27 }