<commit_before>package debuganimations

import (
	"errors"
	"github.com/jkomoros/boardgame"
)

//+autoreader readsetter
type moveMoveCardBetweenShortStacks struct {
	boardgame.BaseMove
	FromFirst bool
}

//+autoreader readsetter
type moveMoveCardBetweenDrawAndDiscardStacks struct {
	boardgame.BaseMove
	FromDraw bool
}

//+autoreader readsetter
type moveFlipHiddenCard struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveMoveCardBetweenFanStacks struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveVisibleShuffleCards struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveShuffleCards struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveMoveBetweenHidden struct {
	boardgame.BaseMove
}

/**************************************************
 *
 * moveMoveCardBetweenShortStacks Implementation
 *
 **************************************************/

var moveMoveCardBetweenShortStacksConfig = boardgame.MoveTypeConfig{
	Name:     "Move Card Between Short Stacks",
	HelpText: "Moves a card between two short stacks",
	MoveConstructor: func(mType *boardgame.MoveType) boardgame.Move {
		return &moveMoveCardBetweenShortStacks{
			BaseMove: boardgame.BaseMove{mType},
		}
	},
}

func (m *moveMoveCardBetweenShortStacks) DefaultsForState(state boardgame.State) {
	gameState, _ := concreteStates(state)

	if gameState.FirstShortStack.NumComponents() < 1 {
		m.FromFirst = false
	}
}

func (m *moveMoveCardBetweenShortStacks) Legal(state boardgame.State, proposer boardgame.PlayerIndex) error {

	game, _ := concreteStates(state)

	if game.FirstShortStack.NumComponents() < 1 && m.FromFirst {
		return errors.New("First short stack has no cards to move")
	}

	if game.SecondShortStack.NumComponents() < 1 && !m.FromFirst {<commit_msg>Fixed a bug introduced when we changed hwo moveTypes work in debuganimations.<commit_after>package debuganimations

import (
	"errors"
	"github.com/jkomoros/boardgame"
)

//+autoreader readsetter
type moveMoveCardBetweenShortStacks struct {
	boardgame.BaseMove
	FromFirst bool
}

//+autoreader readsetter
type moveMoveCardBetweenDrawAndDiscardStacks struct {
	boardgame.BaseMove
	FromDraw bool
}

//+autoreader readsetter
type moveFlipHiddenCard struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveMoveCardBetweenFanStacks struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveVisibleShuffleCards struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveShuffleCards struct {
	boardgame.BaseMove
}

//+autoreader readsetter
type moveMoveBetweenHidden struct {
	boardgame.BaseMove
}

/**************************************************
 *
 * moveMoveCardBetweenShortStacks Implementation
 *
 **************************************************/

var moveMoveCardBetweenShortStacksConfig = boardgame.MoveTypeConfig{
	Name:     "Move Card Between Short Stacks",
	HelpText: "Moves a card between two short stacks",
	MoveConstructor: func(mType *boardgame.MoveType) boardgame.Move {
		return &moveMoveCardBetweenShortStacks{
			BaseMove: boardgame.BaseMove{mType},
		}
	},
}

func (m *moveMoveCardBetweenShortStacks) DefaultsForState(state boardgame.State) {
	gameState, _ := concreteStates(state)

	if gameState.FirstShortStack.NumComponents() < 1 {
		m.FromFirst = false
	} else {
		m.FromFirst = true
	}
}

func (m *moveMoveCardBetweenShortStacks) Legal(state boardgame.State, proposer boardgame.PlayerIndex) error {

	game, _ := concreteStates(state)

	if game.FirstShortStack.NumComponents() < 1 && m.FromFirst {
		return errors.New("First short stack has no cards to move")
	}

	if game.SecondShortStack.NumComponents() < 1 && !m.FromFirst {
{'fraction_non_alphanumeric': 0.13754443532950505, 'fraction_numerical': 0.0016406890894175555, 'mean_word_length': 5.736648250460405, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2866236', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1130, 'n_words': 248}