mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
add phase to delete arrows in to protocol (#6159)
* protocol changes * servatrice changes * add new setting * implement client side with static 4 phases * reading the code explains the code * add subphases to phase.cpp * use new subphase definition
This commit is contained in:
parent
adee67115c
commit
a21e45ed36
16 changed files with 133 additions and 39 deletions
|
|
@ -22,6 +22,28 @@ Phase Phases::getPhase(int phase)
|
|||
}
|
||||
}
|
||||
|
||||
int Phases::getLastSubphase(int phase)
|
||||
{
|
||||
if (0 <= phase && phase < Phases::phaseTypesCount) {
|
||||
return subPhasesEnd[phase];
|
||||
} else {
|
||||
return phase;
|
||||
}
|
||||
}
|
||||
|
||||
QVector<int> getSubPhasesEnd()
|
||||
{
|
||||
QVector<int> array(Phases::phaseTypesCount);
|
||||
for (int phaseEnd = Phases::phaseTypesCount - 1; phaseEnd >= 0;) {
|
||||
int subPhase = phaseEnd;
|
||||
for (; subPhase >= 0 && Phases::phases[phaseEnd].color == Phases::phases[subPhase].color; --subPhase) {
|
||||
array[subPhase] = phaseEnd;
|
||||
}
|
||||
phaseEnd = subPhase;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
const Phase Phases::unknownPhase(QT_TRANSLATE_NOOP("Phase", "Unknown Phase"), "black", "unknown_phase");
|
||||
const Phase Phases::phases[Phases::phaseTypesCount] = {
|
||||
{QT_TRANSLATE_NOOP("Phase", "Untap"), "green", "untap_step"},
|
||||
|
|
@ -35,3 +57,4 @@ const Phase Phases::phases[Phases::phaseTypesCount] = {
|
|||
{QT_TRANSLATE_NOOP("Phase", "End of Combat"), "red", "end_combat"},
|
||||
{QT_TRANSLATE_NOOP("Phase", "Second Main"), "blue", "main_2"},
|
||||
{QT_TRANSLATE_NOOP("Phase", "End/Cleanup"), "green", "end_step"}};
|
||||
const QVector<int> Phases::subPhasesEnd = getSubPhasesEnd();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue