qmlfrontend/team.cpp
author S.D.
Tue, 27 Sep 2022 14:59:03 +0300
changeset 15878 fc3cb23fd26f
parent 14291 f1a5b7baa87f
permissions -rw-r--r--
Allow to see rooms of incompatible versions in the lobby For the new clients the room version is shown in a separate column. There is also a hack for previous versions clients: the room vesion specifier is prepended to the room names for rooms of incompatible versions, and the server shows 'incompatible version' error if the client tries to join them.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14143
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
     1
#include "team.h"
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
     2
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
     3
Hedgehog::Hedgehog()
14291
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
     4
    : name(QObject::tr("unnamed", "default hedgehog name").toUtf8()),
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
     5
      hat("NoHat"),
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
     6
      hp(100),
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
     7
      level(0) {}
14143
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
     8
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
     9
Team::Team()
14291
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
    10
    : name(QObject::tr("unnamed", "default team name").toUtf8()),
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
    11
      color("12345678"),
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
    12
      m_hedgehogsNumber(4) {
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
    13
  m_hedgehogs.resize(8);
14143
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
    14
}
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
    15
14291
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
    16
void Team::resize(int number) { m_hedgehogsNumber = number; }
14143
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
    17
14291
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
    18
QVector<Hedgehog> Team::hedgehogs() const {
f1a5b7baa87f Format team.* code
unc0rr
parents: 14143
diff changeset
    19
  return m_hedgehogs.mid(0, m_hedgehogsNumber);
14143
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents:
diff changeset
    20
}