<commit_before>﻿using System;
using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HearthSpeak
{
    class Locator
    {

        private LogFileParser parser;
        private double CreatureSep;
        private double screenWidth;
        private double screenHeight;
        public Locator(LogFileParser parser)
        {
            this.parser = parser;
            this.screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
            this.screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            CreatureSep = .0731;
        }

        private int[] RatioToCoords(double rx, double ry) {
            int x = (int)(rx * this.screenWidth);
            int y = (int)(ry * this.screenHeight);
            return new int[] { x, y };
        }

        public int[] EndTurnButton()
        {
            return RatioToCoords( .8129, .4518);
        }

        public int[] PlayButton()
        {
            return RatioToCoords(.497, .306);
        }

        public int[] SoloAdventuresButton()
        {
            return RatioToCoords(.4825, .3776);
        }

        public int[] BackButton()
        {
            return RatioToCoords(.8224, .9193);
        }

        public int[] CardInHand(int cardNum)
        {
            Console.WriteLine(cardNum);
            double xpos = -1;
            double ypos = .93;
            cardNum--;
            switch (parser.FriendlyHandCount)
            {
                case 1:
                    xpos = .475;
                    break;
                case 2:
                    xpos = .475 + cardNum * .073;
                    break;
                case 3:
                    xpos = .387 + cardNum * .088;
                    break;
                case 4:
                    xpos = .3304 + cardNum * .0768;
                    break;
                case 5:
                    xpos = .350 + cardNum * .06;
                    break;
                case 6:
                    xpos = .353 + cardNum * .045;
                    break;
                case 7:
                    xpos = .314 + cardNum * .05;
                    break;
                case 8:
                    xpos = .315 + cardNum * .042;
                    ypos = .9635;
                    break;
                case 9:
                    xpos = .312 + cardNum * .037;
                    ypos = .9630;
                    break;
                case 10:
                    xpos = .307 + cardNum * .032;
                    ypos = .9635;
                    break;
            }
            return RatioToCoords(xpos, ypos);
        }

        public int[] FriendlyBoard(int pos)
        {
            double xpos = CreateXPos(pos, parser.FriendlyPlayCount);
            double ypos = .546875;<commit_msg>fix 10 card hand locations<commit_after>﻿using System;
using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HearthSpeak
{
    class Locator
    {

        private LogFileParser parser;
        private double CreatureSep;
        private double screenWidth;
        private double screenHeight;
        public Locator(LogFileParser parser)
        {
            this.parser = parser;
            this.screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
            this.screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            CreatureSep = .0731;
        }

        private int[] RatioToCoords(double rx, double ry) {
            int x = (int)(rx * this.screenWidth);
            int y = (int)(ry * this.screenHeight);
            return new int[] { x, y };
        }

        public int[] EndTurnButton()
        {
            return RatioToCoords( .8129, .4518);
        }

        public int[] PlayButton()
        {
            return RatioToCoords(.497, .306);
        }

        public int[] SoloAdventuresButton()
        {
            return RatioToCoords(.4825, .3776);
        }

        public int[] BackButton()
        {
            return RatioToCoords(.8224, .9193);
        }

        public int[] CardInHand(int cardNum)
        {
            Console.WriteLine(cardNum);
            double xpos = -1;
            double ypos = .93;
            cardNum--;
            switch (parser.FriendlyHandCount)
            {
                case 1:
                    xpos = .475;
                    break;
                case 2:
                    xpos = .475 + cardNum * .073;
                    break;
                case 3:
                    xpos = .387 + cardNum * .088;
                    break;
                case 4:
                    xpos = .3304 + cardNum * .0768;
                    break;
                case 5:
                    xpos = .350 + cardNum * .06;
                    break;
                case 6:
                    xpos = .353 + cardNum * .045;
                    break;
                case 7:
                    xpos = .314 + cardNum * .05;
                    break;
                case 8:
                    xpos = .315 + cardNum * .042;
                    ypos = .9635;
                    break;
                case 9:
                    xpos = .312 + cardNum * .037;
                    ypos = .9630;
                    break;
                case 10:
                    xpos = .307 + cardNum * .033;
                    ypos = .9635;
                    break;
            }
            return RatioToCoords(xpos, ypos);
        }

        public int[] FriendlyBoard(int pos)
        {
            double xpos = CreateXPos(pos, parser.FriendlyPlayCount);
            double ypos = .546875;
{'fraction_non_alphanumeric': 0.08715356458079135, 'fraction_numerical': 0.04322816803207251, 'mean_word_length': 1.0427198291206836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1034037', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1455, 'n_words': 373}