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

public abstract class GenericCard : MonoBehaviour {

    public enum CardStates
    {
        IN_DECK, IN_HAND, IN_PLAY, DISCARDED
    }

    public enum CardTypes
    {
        LESSON, CREATURE, SPELL, ITEM, LOCATION, MATCH, ADVENTURE, CHARACTER
    }
    public enum CostTypes
    {
        CARE_OF_MAGICAL_CREATURES, CHARMS, TRANSFIGURATION, POTIONS, QUIDDITCH
    }

    public CardStates State;
    public CardTypes CardType;

    protected Player _Player;

    private readonly Vector2 COLLIDER_SIZE = new Vector2(50f, 70f);


    //Old zoom tweening constants, remove when new system is in place
    protected bool Zoomed;
    protected readonly float ZoomTweenTime = 0.1f;
    protected readonly float ZoomScale_Hand = 2.5f;
    protected readonly float ZoomScale_InPlay = 2.25f;

    public void Start()
    {
        //Add the collider through code instead of through unity so that if it ever changes, we won't need to edit every prefab.
        if(gameObject.collider == null)
        {
            var col = gameObject.AddComponent<BoxCollider>();
            col.isTrigger = true;
            col.size = new Vector3(COLLIDER_SIZE.x, COLLIDER_SIZE.y, 0.2f);
        }
            
        Zoomed = false;
    }

    public void SetPlayer(Player p)
    {
        _Player = p;
    }

    public void SwitchState(CardStates newState)
    {
        State = newState;
    }

    public void OnMouseOver()
    {
        ShowPreview();
    }

    public void OnMouseExit()
    {
        HidePreview();
    }

    private void ShowPreview()
    {
        gameObject.layer = 9; //switch to preview layer
        if (State != CardStates.IN_DECK && State != CardStates.DISCARDED)
        {
            if (iTween.Count(gameObject) == 0)
            {
                Helper.PreviewCamera.transform.rotation = transform.rotation;
                Helper.PreviewCamera.transform.position = transform.position + 2 * Vector3.back;
            }
            else
            {
                HidePreview();
            }
        }
    }
    
    private void HidePreview()
    {
        gameObject.layer = 0; //switch to default layer
        Helper.PreviewCamera.transform.position = Helper.DefaultPreviewCameraPos;
    }
    
}<commit_msg>Added TODO item<commit_after>﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public abstract class GenericCard : MonoBehaviour {

    public enum CardStates
    {
        IN_DECK, IN_HAND, IN_PLAY, DISCARDED
    }

    public enum CardTypes
    {
        LESSON, CREATURE, SPELL, ITEM, LOCATION, MATCH, ADVENTURE, CHARACTER
    }
    public enum CostTypes
    {
        CARE_OF_MAGICAL_CREATURES, CHARMS, TRANSFIGURATION, POTIONS, QUIDDITCH
    }

    public CardStates State;
    public CardTypes CardType;

    protected Player _Player;

    private readonly Vector2 COLLIDER_SIZE = new Vector2(50f, 70f);


    //Old zoom tweening constants, remove when new system is in place
    protected bool Zoomed;
    protected readonly float ZoomTweenTime = 0.1f;
    protected readonly float ZoomScale_Hand = 2.5f;
    protected readonly float ZoomScale_InPlay = 2.25f;

    public void Start()
    {
        //Add the collider through code instead of through unity so that if it ever changes, we won't need to edit every prefab.
        if(gameObject.collider == null)
        {
            var col = gameObject.AddComponent<BoxCollider>();
            col.isTrigger = true;
            col.size = new Vector3(COLLIDER_SIZE.x, COLLIDER_SIZE.y, 0.2f);
        }
            
        Zoomed = false;
    }

    public void SetPlayer(Player p)
    {
        _Player = p;
    }

    public void SwitchState(CardStates newState)
    {
        State = newState;
    }

    public void OnMouseOver()
    {
        ShowPreview();
    }

    public void OnMouseExit()
    {
        HidePreview();
    }

    private void ShowPreview()
    {
        //TODO: Fix layer-based preview

        gameObject.layer = 9; //switch to preview layer
        if (State != CardStates.IN_DECK && State != CardStates.DISCARDED)
        {
            if (iTween.Count(gameObject) == 0)
            {
                Helper.PreviewCamera.transform.rotation = transform.rotation;
                Helper.PreviewCamera.transform.position = transform.position + 2 * Vector3.back;
            }
            else
            {
                HidePreview();
            }
        }
    }
    
    private void HidePreview()
    {
        gameObject.layer = 0; //switch to default layer
        Helper.PreviewCamera.transform.position = Helper.DefaultPreviewCameraPos;
    }
    
}
{'fraction_non_alphanumeric': 0.07857294542365682, 'fraction_numerical': 0.00891909110214483, 'mean_word_length': 2.05249513933895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3812322', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1344, 'n_words': 360}