public CardTextTranslator(string path, Settings s)
 {
     this.sttngs = s;
     this.pathToConfig = path;
 }
Example #2
0
		//initialize everything here, Game is loaded at this point
        public textchanger()
		{
            this.textsArrField = typeof(CardView).GetField("textsArr", BindingFlags.Instance | BindingFlags.NonPublic);
            this.helpOverlayField = typeof(CardView).GetField("helpOverlay", BindingFlags.Instance | BindingFlags.NonPublic);
            this.renderQueueOffsetsfield = typeof(CardView).GetField("renderQueueOffsets", BindingFlags.Instance | BindingFlags.NonPublic);
            sttngs = new Settings();
            this.pathToConfig = this.OwnFolder() + System.IO.Path.DirectorySeparatorChar;
            ctt = new CardTextTranslator(pathToConfig, sttngs);
            ctt.googlekeys.Add("DE", "0AhhxijYPL-BGdDJaWTI4UVJ3OUZfYzlCSWo3dkZSOXc");
            ctt.googlekeys.Add("FR", "0AsfEX06xqzPEdE9lQlg5NFg2ejBRamltMEhta2FrX2c");
            //ctt.googlekeys.Add("RU", "0AsYOnt3MiugydDRRUEp4eXU0VUloYUxiSW5nVXl0Y1E");//old one
            ctt.googlekeys.Add("RU", "19I6vAusLM-iDWYAh9c7NL27VHjamoV4ZCw-4L55kLqw");
            ctt.googlekeys.Add("SP", "0AprX3iUTAgX9dDcyUUhQSnVndkxCSjVXTzJ6NDA0c3c");


            
            ctt.googleAchivementkeys.Add("RU", "1LVU7ZzOW_oK12va2SoHzp3XfLLFxEOvB5gaZ6OBdRDI");



            ctt.googleTutorialkeys.Add("RU", "14-F9bQMXBdEn_7est4Xtc_b9lajnwdBHJiSqHE5P58w");



           


            try
            {
                App.Communicator.addListener(this);
            }
            catch { }

            return;

            //only for tests###################################

            ctt.googlekeys.Add("test", "1zeYq6pCk8R1jc18mBFucQHsTTAnDMe0F56jqwOl4vU0");//test ding!
            ctt.googleAchivementkeys.Add("test", "1WD7NMAXOJUcn3mm5-ZCQj7nynlvjVug8ZWetHWuTFuU");//test ding!
            ctt.googleTutorialkeys.Add("test", "10KQhaApAQCOhKARzXeY6_T-xUYyC3AiPoj2710d6M7o");//test ding!


            int k = 0;
            int l = 0;
            DateTime itze = DateTime.Now;
            for (int i = 0; i < 1; i++)
            {
                string ttx = this.getDataFromGoogleDocs(ctt.googlekeys["test"]);
                this.getDataFromGoogleDocs(ctt.googleAchivementkeys["test"]);
                this.getDataFromGoogleDocs(ctt.googleTutorialkeys["test"]);
                //Console.WriteLine(ttx);
                ctt.readJsonfromGoogleFast(ttx);
                k++;
            }
            DateTime itze1 = DateTime.Now;

            //Console.WriteLine("#####");
            
            for (int i = 0; i < 1; i++)
            {
                string txt = this.getDataFastFromGoogleDocs(ctt.googlekeys["test"]);
                this.getDataFastFromGoogleDocs(ctt.googleAchivementkeys["test"]);
                this.getDataFastFromGoogleDocs(ctt.googleTutorialkeys["test"]);
                //Console.WriteLine(txt);
                ctt.readJsonfromGoogleFast(txt);
                l++;
            }
            DateTime itze2 = DateTime.Now;


            Console.WriteLine("### "+((itze1 - itze).TotalSeconds/k) + " vs " + ((itze2 - itze1).TotalSeconds/l));
		}