<commit_before>﻿using UnityEngine;
using System.Collections;

public class Brick : MonoBehaviour {

    public int maxHits;
    private int timesHits;
    private BlockSceneManager blockSceneManager;

    // Use this for initialization
    void Start () {
        blockSceneManager = GameObject.FindObjectOfType<BlockSceneManager>();
        timesHits = 0;
    }
	
	// Update is called once per frame
	void Update () {
	
	}

    // Collision collider
    void OnCollisionEnter2D(Collision2D collision)
    {
        timesHits++;
        Debug.Log("Time hits: " + timesHits);

        // TODO 
        // create logic to detect win condition
        //        if(timesHits == 3)
        //        {
        SimulateWin();
        //}
    }

    // method to simulate win while the logic to is on hold
    private void SimulateWin()
    {<commit_msg>Title: Added logic to destroy bricks. It is based on the max hits set for the brick. Developer: Celso<commit_after>﻿using UnityEngine;
using System.Collections;

public class Brick : MonoBehaviour {

    public int maxHits;
    private int timesHits;
    private BlockSceneManager blockSceneManager;

    // Use this for initialization
    void Start () {
        blockSceneManager = GameObject.FindObjectOfType<BlockSceneManager>();
        timesHits = 0;
    }
	
	// Update is called once per frame
	void Update () {
	
	}

    // Collision collider
    void OnCollisionEnter2D(Collision2D collision)
    {
        timesHits++;

        // extending the idea of the ball to do two hits at once.
        if(maxHits >= timesHits)
        {
            // destroy object
            Destroy(gameObject);
        }

    }

    // method to simulate win while the logic to is on hold
    private void SimulateWin()
    {
{'fraction_non_alphanumeric': 0.07879818594104308, 'fraction_numerical': 0.003968253968253968, 'mean_word_length': 2.214936247723133, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3706485', 'n_tokens_mistral': 506, 'n_tokens_neox': 476, 'n_words': 158}