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

public class Patient : Switchable
{
    private bool treated;
	public Sprite treatedSprite;

    private bool isHeld;

    private Timer timer;

    PlayerController player;
    Vector2 lastPlayerDirection;

    public Material GUIpie;
    public Texture progressTexture;
    Vector2 guiPosition;

    // Use this for initialization
    protected override void Start()
    {
        base.Start();

        treated = false;

        player = GameObject.FindObjectOfType<PlayerController>();

        timer = new Timer(1.2f, Finish);
    }

    protected override void Update()
    {
        base.Update();

        timer.Update();

        if (isHeld)
        {
            if(player.NextDirection != lastPlayerDirection)
            {
                Interrupted();
            }
        }
    }

    void OnGUI()
    {
        GUIpie.SetFloat("Value", timer.progress);
        GUIpie.SetFloat("Clockwise", 0);

        Graphics.DrawTexture(new Rect(guiPosition.x - Screen.width * 0.01f, guiPosition.y - Screen.width * 0.04f, Screen.width * 0.02f, Screen.width * 0.02f), progressTexture, GUIpie);
    }


    public bool IsTreated()
    {
        return treated;
    }

    public override void Switch()
    {
        if (!treated && !timer.running)
        {
            player.AnimState = PlayerController.PlayerAnimState.Wash;

            isHeld = true;

            timer.Reset();

            lastPlayerDirection = player.NextDirection;

            Vector2 p = Camera.main.WorldToScreenPoint(player.transform.position);
            p.y = Screen.height - p.y;

            guiPosition = p;

        }
    }

    void Finish()
    {
        spriteRenderer.sprite = treatedSprite;

        Interrupted();

        if (player.GetComponent<HandController>().state != HandController.HandState.Clean)<commit_msg>Patient treatment minor fix<commit_after>﻿using UnityEngine;
using System.Collections;

public class Patient : Switchable
{
    private bool treated;
	public Sprite treatedSprite;

    private bool isHeld;

    private Timer timer;

    PlayerController player;
    Vector2 lastPlayerDirection;

    public Material GUIpie;
    public Texture progressTexture;
    Vector2 guiPosition;

    // Use this for initialization
    protected override void Start()
    {
        base.Start();

        treated = false;

        player = GameObject.FindObjectOfType<PlayerController>();

        timer = new Timer(1.2f, Finish);
    }

    protected override void Update()
    {
        base.Update();

        timer.Update();

        if (isHeld)
        {
            if(player.NextDirection != lastPlayerDirection)
            {
                Interrupted();
            }
        }
    }

    void OnGUI()
    {
        GUIpie.SetFloat("Value", timer.progress);
        GUIpie.SetFloat("Clockwise", 0);

        Graphics.DrawTexture(new Rect(guiPosition.x - Screen.width * 0.01f, guiPosition.y - Screen.width * 0.04f, Screen.width * 0.02f, Screen.width * 0.02f), progressTexture, GUIpie);
    }


    public bool IsTreated()
    {
        return treated;
    }

    public override void Switch()
    {
        if (!treated && !isHeld)
        {
            player.AnimState = PlayerController.PlayerAnimState.Wash;

            isHeld = true;

            timer.Reset();

            lastPlayerDirection = player.NextDirection;

            Vector2 p = Camera.main.WorldToScreenPoint(player.transform.position);
            p.y = Screen.height - p.y;

            guiPosition = p;

        }
    }

    void Finish()
    {
        spriteRenderer.sprite = treatedSprite;

        Interrupted();

        if (player.GetComponent<HandController>().state != HandController.HandState.Clean)
{'fraction_non_alphanumeric': 0.09773635153129161, 'fraction_numerical': 0.009587217043941412, 'mean_word_length': 2.0412955465587044, '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': '3304972', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1016, 'n_words': 230}