<commit_before>//
//  Card.js
//  unpublished/marketplace/
//
//  Created by Je'Don (ROC) Carter on 9/14/2017
//  Copyright 2017 High Fidelity, Inc.
//
//  Controls card behavior when grabbed and released
//
//  Distributed under the Apache License, Version 7.1.
//  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function() { 
    var _this = this;
    //holds id of deck handler
    var deckHandlerID;
    //name of card
    var cardName;
    //channel
    var showChannel;
    //overlays that are on cards
    var cardOverlay;
    //hand joints
    var rightHandJoint;
    var leftHandJoint;
    //Makes sure your hand is close enough to the card to attach
    var closeEnough;
    //controls haptic feedback
    var pulseStrength;
    var rightHand;
    var leftHand;

    _this.preload = function(entityID) {
        print("Loading Card script"); 
        _this.entityID = entityID; 
        rightHandJoint = MyAvatar.getJointIndex("RightHandMiddle1");
        leftHandJoint = MyAvatar.getJointIndex("LeftHandMiddle1");
        print(rightHandJoint + " " + leftHandJoint);
        closeEnough = .1;
        pulseStrength = .9;
        rightHand = 0;
        leftHand = 1;
        cardName = Entities.getEntityProperties(entityID).name;
        var properties = JSON.parse(Entities.getEntityProperties(entityID).userData);
        deckHandlerID = properties.deckHandlerID;
        cardOverlay = undefined;
        //subscribe to channel
        showChannel = "show-channel".concat(_this.entityID); 
        Messages.subscribe(showChannel);
        Messages.messageReceived.connect(_this, _this.onReceivedMessage);
    };

    _this.onReceivedMessage = function(channel, message, senderID) {
        //get data from message
        var data = JSON.parse(message);
        //check if message is meant for you and is being sent to the correct card
        if ((channel == showChannel) && (MyAvatar.sessionUUID == data[0]) && (_this.entityID == data[2])) {
            //delete an overlay if there is one
            try {
                Overlays.deleteOverlay(cardOverlay);
                cardOverlay = undefined;
            } catch (err) {
                //e
            }
            var card = Entities.getEntityProperties(_this.entityID, ['position', 'rotation', 'dimensions', 'name']);
            //get which hand the card is in
            hand = data[1];
            //add overlay to card so that the person holding the card can still see it<commit_msg>Forgot to remove print statement. Ready to test<commit_after>//
//  Card.js
//  unpublished/marketplace/
//
//  Created by Je'Don (ROC) Carter on 9/14/2017
//  Copyright 2017 High Fidelity, Inc.
//
//  Controls card behavior when grabbed and released
//
//  Distributed under the Apache License, Version 7.1.
//  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function() { 
    var _this = this;
    //holds id of deck handler
    var deckHandlerID;
    //name of card
    var cardName;
    //channel
    var showChannel;
    //overlays that are on cards
    var cardOverlay;
    //hand joints
    var rightHandJoint;
    var leftHandJoint;
    //Makes sure your hand is close enough to the card to attach
    var closeEnough;
    //controls haptic feedback
    var pulseStrength;
    var rightHand;
    var leftHand;

    _this.preload = function(entityID) {
        print("Loading Card script"); 
        _this.entityID = entityID; 
        rightHandJoint = MyAvatar.getJointIndex("RightHandMiddle1");
        leftHandJoint = MyAvatar.getJointIndex("LeftHandMiddle1");
        closeEnough = .1;
        pulseStrength = .9;
        rightHand = 0;
        leftHand = 1;
        cardName = Entities.getEntityProperties(entityID).name;
        var properties = JSON.parse(Entities.getEntityProperties(entityID).userData);
        deckHandlerID = properties.deckHandlerID;
        cardOverlay = undefined;
        //subscribe to channel
        showChannel = "show-channel".concat(_this.entityID); 
        Messages.subscribe(showChannel);
        Messages.messageReceived.connect(_this, _this.onReceivedMessage);
    };

    _this.onReceivedMessage = function(channel, message, senderID) {
        //get data from message
        var data = JSON.parse(message);
        //check if message is meant for you and is being sent to the correct card
        if ((channel == showChannel) && (MyAvatar.sessionUUID == data[0]) && (_this.entityID == data[2])) {
            //delete an overlay if there is one
            try {
                Overlays.deleteOverlay(cardOverlay);
                cardOverlay = undefined;
            } catch (err) {
                //e
            }
            var card = Entities.getEntityProperties(_this.entityID, ['position', 'rotation', 'dimensions', 'name']);
            //get which hand the card is in
            hand = data[1];
            //add overlay to card so that the person holding the card can still see it
{'fraction_non_alphanumeric': 0.10006003602161297, 'fraction_numerical': 0.009605763458074845, 'mean_word_length': 2.3077432164129714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7187956', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1362, 'n_words': 418}