<commit_before>package fsm

import (
	"errors"
)

type State interface {
	ToPlayTile() (State, error)
	ToFoundCorp() (State, error)
	ToUntieMerge() (State, error)
	ToSellTrade() (State, error)
	ToBuyStock() (State, error)
	ToEndGame() (State, error)
}

type PlayTile struct{}

func (s *PlayTile) ToPlayTile() (State, error) {
	return s, errors.New("Already in state PlayTile")
}

func (s *PlayTile) ToFoundCorp() (State, error) {
	return &FoundCorp{}, nil
}

func (s *PlayTile) ToUntieMerge() (State, error) {
	return s, nil
}

func (s *PlayTile) ToSellTrade() (State, error) {
	return s, errors.New("State transition not allowed")
}

func (s *PlayTile) ToBuyStock() (State, error) {
	return s, nil
}

func (s *PlayTile) ToEndGame() (State, error) {
	return s, nil
}
<commit_msg>Fixed state transitions<commit_after>package fsm

import (
	"errors"
)

type State interface {
	ToPlayTile() (State, error)
	ToFoundCorp() (State, error)
	ToUntieMerge() (State, error)
	ToSellTrade() (State, error)
	ToBuyStock() (State, error)
	ToEndGame() (State, error)
}

type PlayTile struct{}

func (s *PlayTile) ToPlayTile() (State, error) {
	return s, errors.New("Already in state PlayTile")
}

func (s *PlayTile) ToFoundCorp() (State, error) {
	return &FoundCorp{}, nil
}

func (s *PlayTile) ToUntieMerge() (State, error) {
	return &UntieMerge{}, nil
}

func (s *PlayTile) ToSellTrade() (State, error) {
	return s, errors.New("State transition not allowed")
}

func (s *PlayTile) ToBuyStock() (State, error) {
	return &BuyStock{}, nil
}

func (s *PlayTile) ToEndGame() (State, error) {
	return &EndGame{}, nil
}

{'fraction_non_alphanumeric': 0.15572232645403378, 'fraction_numerical': 0.0, 'mean_word_length': 5.177606177606178, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4682915', 'n_tokens_mistral': 615, 'n_tokens_neox': 591, 'n_words': 178}