<commit_before>package yotris.logic;
import java.util.Observable;
import yotris.ui.UserInterface;
import yotris.util.Settings;

public class GameLogic extends Observable {
	private UserInterface ui;
	private Grid grid;
	private Settings settings;
	private Piece fallingPiece;
	private int score;
	
	public GameLogic(UserInterface ui, Settings settings)	 {
		this.ui = ui;
		this.settings = settings;
		this.reset(settings);
	}

	private void reset(Settings settings) {
		this.grid = new Grid(settings.getGridWidth(), settings.getGridHeight());	
		fallingPiece = null;
		score = 0;
	}

	public GameState update() {
		GameState state = new GameState(true);	
		state.running = false;

		Grid renderGrid = getRenderGrid();
		state.renderGrid = renderGrid;

		notifyObservers(state);

		return state;
	}

	public Grid getRenderGrid() {
		Grid renderGrid = new Grid(this.grid.getWidth(), this.grid.getHeight());
		renderGrid.plotPiece(fallingPiece);
		return renderGrid;
	}

}
<commit_msg>fix ui observer adding<commit_after>package yotris.logic;
import java.util.Observable;
import yotris.ui.UserInterface;
import yotris.util.Settings;

public class GameLogic extends Observable {
	private UserInterface ui;
	private Grid grid;
	private Settings settings;
	private Piece fallingPiece;
	private int score;
	
	public GameLogic(UserInterface ui, Settings settings)	 {
		this.ui = ui;
		this.settings = settings;
		this.reset(settings);

		addObserver(ui);
	}

	private void reset(Settings settings) {
		this.grid = new Grid(settings.getGridWidth(), settings.getGridHeight());	
		fallingPiece = null;
		score = 0;
	}

	public GameState update() {
		GameState state = new GameState(true);	
		state.running = false;

		Grid renderGrid = getRenderGrid();
		state.renderGrid = renderGrid;

		notifyObservers(state);

		return state;
	}

	public Grid getRenderGrid() {
		Grid renderGrid = new Grid(this.grid.getWidth(), this.grid.getHeight());
		renderGrid.plotPiece(fallingPiece);
		return renderGrid;
	}

}

{'fraction_non_alphanumeric': 0.10175438596491228, 'fraction_numerical': 0.0010025062656641604, 'mean_word_length': 4.606741573033708, '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': '2257640', 'n_tokens_mistral': 675, 'n_tokens_neox': 624, 'n_words': 160}