Exemple #1
0
/* FIXME double check and remove editMove, unnecessary */
void Tree::doPass(bool /*sgf*/, bool /*fastLoad*/)
{
//	if (lastValidMove == NULL)
//	{
//		stoneHandler->checkAllPositions();
//	}

/////////////////FIXME We may have a problem at first move with handicap games ...
	StoneColor c = (current->getColor() == stoneWhite) ? stoneBlack : stoneWhite;
	
//	currentMove++;
	addMove(c, 20, 20);
#ifdef OLD
	if (!sgf)
		addMove(c, 20, 20);
	else  // Sgf reading
	{
		if (current->parent != NULL)
			c = current->parent->getColor() == stoneBlack ? stoneWhite : stoneBlack;
		else
			c = stoneBlack;
		if (!fastLoad)
			editMove(c, 20, 20);
	}
#endif //OLD
	if (current->parent != NULL)
		current->setCaptures(current->parent->getCapturesBlack(),
		current->parent->getCapturesWhite());
}
Exemple #2
0
void b_update_clicked(GtkWidget *obj, gpointer user_data)
{
	if(currMove == -1) {
		return;
	}

	// Set script text
	moveFile.moves[currMove].script = getTextViewText(tv_script);
	moveFile.moves[currMove].scriptLen = getTextViewLen(tv_script);

	// Gtk sets currMove to -1 when entries are removed
	int tmpCurrMove = currMove;

	editMove((char*)gtk_entry_get_text(GTK_ENTRY(e_name)), currMove);
	updateMoves();

	gtk_combo_box_set_active(GTK_COMBO_BOX(cbt_move), tmpCurrMove);

}