qmlfrontend/team.cpp
author Wuzzy <Wuzzy2@mail.ru>
Mon, 08 Jul 2019 21:44:26 +0200
changeset 15220 ceb289e8a582
parent 14291 f1a5b7baa87f
permissions -rw-r--r--
King Mode: Fix king placement phase not working correctly with multiple teams in a clan New king placement phase rules: * Before the game begins, each team can walk with their king and teleport for free, everything else is disabled * This special round does not count towards the round counter, like in gfPlaceHog * TotalRounds is set to -1 during this round, like in gfPlaceHog Under the old rules, this was much more hacky. The delay of all delay-less weapons was just set to 1 The problem with the old rules was that if any clan had more than 1 team, eventually the weapon delay will time out before all kings have been placed.
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
}