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

public class Score : MonoBehaviour {

    public static int starCaughtCount;
    public static int level;
    private static Constellations constellations;
    internal static readonly int LEVEL_ONE = 0;
    internal static readonly int LEVEL_TWO = 1;
    internal static readonly int LEVEL_THREE = 2;

    public static float environmentDamageScore;
    public static float cumulativeEnvironmentDamageScore;
    public static int totalStarsToBeCaught;
    public static int minStarCaught;

    
    public int totalStarsToBeCaughtUser;
    public int minStarCaughtUser;


    private static BackingTracks BackingTracks;

    // Use this for initialization
    void Start () {
        starCaughtCount = 0;
        minStarCaught = 3;
        totalStarsToBeCaught = 10;
        SetLevel(2);
        if (totalStarsToBeCaughtUser > 0) 
        {
            totalStarsToBeCaught = totalStarsToBeCaughtUser;
        }

        if (minStarCaughtUser > 0)
        {
            minStarCaught = minStarCaughtUser;
        }

        constellations = FindObjectOfType<Constellations>();
        if (null == constellations)
        {
            Debug.Log("ERROR: no constellation manager found");
        }

        BackingTracks = FindObjectOfType<BackingTracks>();
        if (null == BackingTracks)
        {
            Debug.LogWarning("WARN: no BackingTracks found");
        }

    }

    public static Vector3 catchStar()
    {
        starCaughtCount++;
        Debug.Log("caught star " + starCaughtCount);
        effectEnvironment();

        //TODO: add toggle for game type
        // if (0 == (constellationScore % 10))
        // {
        //     SetLevel(level+1);
        // }
        return constellations.GetNextEmptyPosition().transform.position;
    }

    public static void SetLevel(int level)
    {
        Score.level = level;
        Score.level %= 3;
        //BackingTracks.UpdateLevel();
    }

    internal static int GetCurrentLevel()
    {
        return level;
    }

    public static void effectEnvironment()
    {
        // TODO: replace formula
        environmentDamageScore = starCaughtCount / totalStarsToBeCaught;
        cumulativeEnvironmentDamageScore = environmentDamageScore;

    }
    void Update(){
        if (Input. GetKeyUp("c")){
            starCaughtCount++;
            Debug.Log("key press caught star " + starCaughtCount);
        }
    }
}<commit_msg>Update Score.cs<commit_after>﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Score : MonoBehaviour {

    public static int starCaughtCount;
    public static int level;
    private static Constellations constellations;
    internal static readonly int LEVEL_ONE = 0;
    internal static readonly int LEVEL_TWO = 1;
    internal static readonly int LEVEL_THREE = 2;

    public static float environmentDamageScore;
    public static float cumulativeEnvironmentDamageScore;
    public static int totalStarsToBeCaught;
    public static int minStarCaught;

    
    public int totalStarsToBeCaughtUser;
    public int minStarCaughtUser;


    private static BackingTracks BackingTracks;

    // Use this for initialization
    void Start () {
        starCaughtCount = 0;
        minStarCaught = 3;
        totalStarsToBeCaught = 10;
        SetLevel(2);
        if (totalStarsToBeCaughtUser > 0) 
        {
            totalStarsToBeCaught = totalStarsToBeCaughtUser;
        }

        if (minStarCaughtUser > 0)
        {
            minStarCaught = minStarCaughtUser;
        }

        constellations = FindObjectOfType<Constellations>();
        if (null == constellations)
        {
            Debug.Log("ERROR: no constellation manager found");
        }

        BackingTracks = FindObjectOfType<BackingTracks>();
        if (null == BackingTracks)
        {
            Debug.LogWarning("WARN: no BackingTracks found");
        }

    }

    public static Vector3 catchStar()
    {
        starCaughtCount++;
        Debug.Log("caught star " + starCaughtCount);
        checkEffectOnEnvironment();

        //TODO: add toggle for game type
        // if (0 == (constellationScore % 10))
        // {
        //     SetLevel(level+1);
        // }
        return constellations.GetNextEmptyPosition().transform.position;
    }

    public static void SetLevel(int level)
    {
        Score.level = level;
        Score.level %= 3;
        //BackingTracks.UpdateLevel();
    }

    internal static int GetCurrentLevel()
    {
        return level;
    }

    public static void checkEffectOnEnvironment()
    {
        // TODO: replace formula
        if (minStarCaught < starCaughtCount & starCaughtCount <= (totalStarsToBeCaught + minStarCaught)) {
            environmentDamageScore = (float) (starCaughtCount - minStarCaught) / totalStarsToBeCaught;
            cumulativeEnvironmentDamageScore = environmentDamageScore;
            Debug.Log("environmental damage " + cumulativeEnvironmentDamageScore);
        }

    }
    void Update(){
        if (Input. GetKeyUp("c")){
            starCaughtCount++;
            checkEffectOnEnvironment();
            Debug.Log("key press caught star " + starCaughtCount);
        }
    }
}
{'fraction_non_alphanumeric': 0.08073014678208505, 'fraction_numerical': 0.0060218291305984195, 'mean_word_length': 2.3135910224438905, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5550356', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1451, 'n_words': 355}