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

public class DamageDealer : MonoBehaviour {
    public float damageToDeal = 1;
	// Use this for initialization

    void OnCollisionStay2D(Collision2D col)
    {
        OnTriggerEnter2D(col.collider);
    }

    void OnTriggerStay2D(Collider2D col)
    {
        OnTriggerEnter2D(col);
    }

    void OnCollisionEnter2D(Collision2D col)
    {
        OnTriggerEnter2D(col.collider);
    }

    void OnTriggerEnter2D(Collider2D col)
    {
		col.GetComponent<PlayerStatus>().TakeDamage (damageToDeal);
		var knockbackAngle = -(transform.position - col.gameObject.transform.position).normalized;
		knockbackAngle.Normalize ();
		col.GetComponent<PlayerMovement>().KnockBack (knockbackAngle);
//        col.transform.BroadcastMessage("TakeDamage",new CollisionData(damageToDeal,gameObject), SendMessageOptions.DontRequireReceiver);
    }
}
<commit_msg>Refactor to not use unity's lifecycle event as a method directly<commit_after>﻿using UnityEngine;
using System.Collections;

public class DamageDealer : MonoBehaviour {

    public float damageToDeal = 1;

    void OnCollisionStay2D(Collision2D col)
    {
		handleCollision(col.collider);
    }

    void OnTriggerStay2D(Collider2D col)
    {
		handleCollision(col);
    }

    void OnCollisionEnter2D(Collision2D col)
    {
		handleCollision(col.collider);
    }

    void OnTriggerEnter2D(Collider2D col)
    {
		handleCollision (col);
    }

	private void handleCollision (Collider2D col)
	{
		col.GetComponent<PlayerStatus> ().TakeDamage (damageToDeal);
		var knockbackAngle = -(transform.position - col.gameObject.transform.position).normalized;
		knockbackAngle.Normalize ();
		col.GetComponent<PlayerMovement> ().KnockBack (knockbackAngle);
	}
}

{'fraction_non_alphanumeric': 0.09575070821529745, 'fraction_numerical': 0.012464589235127478, 'mean_word_length': 4.118840579710145, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4798016', 'n_tokens_mistral': 604, 'n_tokens_neox': 562, 'n_words': 98}