<commit_before>package simpleslickgame;

import java.util.Observable;
import java.util.Observer;

import org.newdawn.slick.GameContainer;


import simpleslickgame.TVTick;
public class TVPlayState extends TVGameState implements Observer { 
	
	TVGrid grid;
	GameContainer gameContainer;
	TVTick tick;
	TVShape currShape;
	TVShapeFactory shapeFactory;
	
	public TVPlayState(TVInvoker i) {
		super(i);
		this.grid = new TVGrid();
		this.gameContainer = i.gc;
		this.tick = new TVTick(1000);
		this.grid = new TVGrid();
		this.shapeFactory = new TVShapeFactory();
		this.currShape = shapeFactory.createShape("TVOshape");
		currShape.addObserver(this);
		//create factory and use factory to create cuurShape
		// since shape is observable, shape.addObserver and pass this
	} 

	@Override
	void pressLeft() {
		currShape.moveLeft();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressRight() {
		currShape.moveRight();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressDown() {
		currShape.moveDown();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressA() {
		currShape.rotateLeft();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressB() {
		currShape.rotateRight();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressPause() {
		invoker.setGameState(invoker.getPauseState());
	}

	@Override
	void renderGameboard() {
		currShape.drawShape();
		grid.drawBlocks();
		
	}

	@Override
	void updateGameboard(int i) { 
		// called every single frame
		if(tick.update(i)){
			// do logic that needs to happen
			currShape.moveDown();
		}
	}

	@Override
	public void update(Observable o, Object arg) {
		// ccast o to tvshape
		// this update is for collision
		
		grid.isCollided((TVShape)o);
		currShape = shapeFactory.createShape("TVOshape");
		//set current shape to new shape and bind to new shape

	}

}
<commit_msg>Storing<commit_after>package simpleslickgame;

import java.util.Observable;
import java.util.Observer;

import org.newdawn.slick.GameContainer;


import simpleslickgame.TVTick;
public class TVPlayState extends TVGameState implements Observer { 
	
	TVGrid grid;
	GameContainer gc;
	TVTick tick;
	TVShape currShape;
	TVShapeFactory shapeFactory;
	
	public TVPlayState(TVInvoker i) {
		super(i);
		this.grid = new TVGrid();
		this.gc = i.gc;
		this.tick = new TVTick(1000);
		this.grid = new TVGrid();
		this.shapeFactory = new TVShapeFactory(gc);
		this.currShape = shapeFactory.createShape("TVOshape");
		currShape.addObserver(this);
		//create factory and use factory to create cuurShape
		// since shape is observable, shape.addObserver and pass this
	} 

	@Override
	void pressLeft() {
		currShape.moveLeft();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressRight() {
		currShape.moveRight();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressDown() {
		currShape.moveDown();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressA() {
		currShape.rotateLeft();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressB() {
		currShape.rotateRight();
		grid.updateCurrentShape(currShape);
	}

	@Override
	void pressPause() {
		invoker.setGameState(invoker.getPauseState());
	}

	@Override
	void renderGameboard() {
		currShape.drawShape();
		grid.drawBlocks();
		
	}

	@Override
	void updateGameboard(int i) { 
		// called every single frame
		if(tick.update(i)){
			// do logic that needs to happen
			currShape.moveDown();
		}
	}

	@Override
	public void update(Observable o, Object arg) {
		// ccast o to tvshape
		// this update is for collision
		
		grid.isCollided((TVShape)o);
		currShape = shapeFactory.getRandomShape();
		//set current shape to new shape and bind to new shape

	}

}

{'fraction_non_alphanumeric': 0.11078246840548535, 'fraction_numerical': 0.0021511158913686476, 'mean_word_length': 4.173852573018081, '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': '508043', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1211, 'n_words': 288}