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

public class VotingBooth : MonoBehaviour {
    void Start()
    {
        GameManager.ms_instance.AddVotingBooth(this);
    }

    void OnCollisionEnter2D(Collision2D coll)
    {
        //check to see if the colliding gameobject is visible. If it is not, return.
        Vector3 viewPosition = Camera.main.WorldToViewportPoint(coll.gameObject.transform.position);

        if(viewPosition.x > 1.0f || viewPosition.x < 0.0f || viewPosition.y < 0.0f || viewPosition.y > 1.0f)
        {
            return;
        }

        if(coll.gameObject.tag == "Voter")
        {
            Voter voter = coll.gameObject.GetComponent<Voter>();

            if (voter.GetTeam() == Voter.Team.BlueTeam)
            {
                voter.CastBlueVote(voter);
            }
            else
            {
                voter.CastRedVote(voter);

            }

            GameManager.ms_instance.RemoveVoter(coll.gameObject.GetComponent<Voter>());
        }<commit_msg>Fixes #19<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VotingBooth : MonoBehaviour {
    void Start()
    {
        GameManager.ms_instance.AddVotingBooth(this);
    }

    void OnCollisionEnter2D(Collision2D coll)
    {
        //check to see if the colliding gameobject is visible. If it is not, return.
        Vector3 viewPosition = Camera.main.WorldToViewportPoint(coll.gameObject.transform.position);

        if(viewPosition.x > 1.0f || viewPosition.x < 0.0f || viewPosition.y < 0.0f || viewPosition.y > 1.0f)
        {
            return;
        }

        if(coll.gameObject.tag == "Voter")
        {
            Voter voter = coll.gameObject.GetComponent<Voter>();

            if (voter.GetTeam() == Voter.Team.BlueTeam)
            {
                voter.CastBlueVote(voter is Leader);
            }
            else
            {
                voter.CastRedVote(voter is Leader);

            }

            GameManager.ms_instance.RemoveVoter(coll.gameObject.GetComponent<Voter>());
        }
{'fraction_non_alphanumeric': 0.10479323308270677, 'fraction_numerical': 0.011278195488721804, 'mean_word_length': 2.0070621468926553, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2445652', 'n_tokens_mistral': 659, 'n_tokens_neox': 630, 'n_words': 113}