lastCshouted = 0;
status = NEW;
+ paused = FALSE;
}
//- Deconstructor ---------------------------------------------------------
playerIter.Reset();
while((opponent = playerIter.Next())) {
if(strcmp(tp->name, opponent->name) && (tp->activeFlag !=0)) { // If this isn't MY name & I am active
- if((!tp->AlreadyPlayed(opponent->name)) && (!opponent->IsPaired()) && (opponent->activeFlag != 0)) {
+ if((!tp->AlreadyPlayed(opponent->name)) && (!opponent->IsPaired()) && (opponent->activeFlag != 0)
+ && (tp->ColorDue() != opponent->ColorDue() // they are due different color, never a problem
+ || tp->ColorDue() ? // both are due white. Check if one of them could accept black without breaking 'absolute' color rules
+ tp->GetConsecutiveBlacks() < 2 &&
+ tp->GetTotalBlacks() - tp->GetTotalWhites() < 2 ||
+ opponent->GetConsecutiveBlacks() < 2 &&
+ opponent->GetTotalBlacks() - opponent->GetTotalWhites() < 2
+ : // both are due black. Check if any of them can accept white
+ tp->GetConsecutiveWhites() < 2 &&
+ tp->GetTotalWhites() - tp->GetTotalBlacks() < 2 ||
+ opponent->GetConsecutiveWhites() < 2 &&
+ opponent->GetTotalWhites() - opponent->GetTotalBlacks() < 2
+ )
+ ) {
// and I haven't played this person and this person is active. (not forfeited)
t = GetSortPlayer(opponent->name);
score = ((abs(t->value - (me->value + offset))) * 1000);
status = DONE;
}//- End EndTourney
+//- IsPaused --------------------------------------------------------
+int Tourney::IsPaused(void) {
+ return paused;
+}
+
+//- SetPause -----------------------
+void Tourney::SetPause(int x) {
+ paused = x;
+}//- End SetPause
+
//- Announce ----------------------------------------------------------
void Tourney::Announce(void) {
char temp[128];
while((g = gameIter.Next())) {
/* note that we rely on rmatch and on the ; separated commands from lasker */
+ sleep(2);
gMamer.XServerCom("rmatch %s %s %i %i %c %s white ; rmatch %s %s %i %i %c %s black\n",
g->whiteName, g->blackName, g->time, g->inc, params.mode, Variant,
g->blackName, g->whiteName, g->time, g->inc, params.mode, Variant);