package student.tutorial;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class common {
private static common mostCurrent = new common();
public static Object getObject() {
    throw new RuntimeException("Code module does not support this method.");
}
 public anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4a.objects.MediaPlayerWrapper _mp1 = null;
public static anywheresoftware.b4a.objects.MediaPlayerWrapper _mpgame1 = null;
public student.tutorial.main _main = null;
public student.tutorial.frmgame1 _frmgame1 = null;
public student.tutorial.settings _settings = null;
public student.tutorial.frmgame1_result _frmgame1_result = null;
public student.tutorial.frmgame1_final _frmgame1_final = null;
public student.tutorial.frmgame2 _frmgame2 = null;
public student.tutorial.frmgame3 _frmgame3 = null;
public student.tutorial.frmgame4 _frmgame4 = null;
public student.tutorial.frmgame5 _frmgame5 = null;
public student.tutorial.frmgame6 _frmgame6 = null;
public student.tutorial.frmgame7 _frmgame7 = null;
public student.tutorial.frmcontact _frmcontact = null;
public student.tutorial.frmgame8 _frmgame8 = null;
public student.tutorial.frmabout _frmabout = null;
public student.tutorial.frmgame9 _frmgame9 = null;
public student.tutorial.setting _setting = null;
public student.tutorial.frmstatistic _frmstatistic = null;
public static String  _changetheme(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ImageViewWrapper _img1) throws Exception{
String _s1 = "";
 //BA.debugLineNum = 73;BA.debugLine="Sub changeTheme(img1 As ImageView)";
 //BA.debugLineNum = 74;BA.debugLine="Dim s1 As String";
_s1 = "";
 //BA.debugLineNum = 75;BA.debugLine="s1 = settings.getData(\"settingApp.app\",\"theme\")";
_s1 = mostCurrent._settings._getdata(_ba,"settingApp.app","theme");
 //BA.debugLineNum = 76;BA.debugLine="If s1 <> \"\" AND File.Exists(File.DirAssets,s1) = T";
if ((_s1).equals("") == false && anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_s1)==anywheresoftware.b4a.keywords.Common.True) { 
 //BA.debugLineNum = 77;BA.debugLine="img1.Bitmap = LoadBitmap(File.DirAssets,s1)";
_img1.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_s1).getObject()));
 };
 //BA.debugLineNum = 79;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.collections.List  _getitemsql(anywheresoftware.b4a.BA _ba) throws Exception{
anywheresoftware.b4a.objects.collections.List _l1 = null;
int _i = 0;
anywheresoftware.b4a.sql.SQL _s1 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c1 = null;
 //BA.debugLineNum = 121;BA.debugLine="Sub getItemSql As List";
 //BA.debugLineNum = 122;BA.debugLine="Dim l1 As List";
_l1 = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 123;BA.debugLine="l1.Initialize";
_l1.Initialize();
 //BA.debugLineNum = 124;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 125;BA.debugLine="Dim s1 As SQL";
_s1 = new anywheresoftware.b4a.sql.SQL();
 //BA.debugLineNum = 126;BA.debugLine="Dim c1 As Cursor";
_c1 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 127;BA.debugLine="If File.Exists(File.DirInternal,\"book.db\") = False";
if (anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"book.db")==anywheresoftware.b4a.keywords.Common.False) { 
 //BA.debugLineNum = 128;BA.debugLine="File.Copy(File.DirAssets,\"book.db\",File.DirInter";
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"book.db",anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"book.db");
 };
 //BA.debugLineNum = 130;BA.debugLine="s1.Initialize(File.DirInternal,\"book.db\",False)";
_s1.Initialize(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"book.db",anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 131;BA.debugLine="c1 = s1.ExecQuery(\"SELECT sQuestion,sAnswer FROM t";
_c1.setObject((android.database.Cursor)(_s1.ExecQuery("SELECT sQuestion,sAnswer FROM tbl_data")));
 //BA.debugLineNum = 132;BA.debugLine="i = Rnd(0,c1.RowCount-1)";
_i = anywheresoftware.b4a.keywords.Common.Rnd((int) (0),(int) (_c1.getRowCount()-1));
 //BA.debugLineNum = 133;BA.debugLine="c1.Position = i";
_c1.setPosition(_i);
 //BA.debugLineNum = 134;BA.debugLine="l1.Add(c1.GetString(\"sQuestion\"))";
_l1.Add((Object)(_c1.GetString("sQuestion")));
 //BA.debugLineNum = 135;BA.debugLine="l1.Add(c1.GetString(\"sAnswer\"))";
_l1.Add((Object)(_c1.GetString("sAnswer")));
 //BA.debugLineNum = 136;BA.debugLine="c1.Close";
_c1.Close();
 //BA.debugLineNum = 137;BA.debugLine="s1.Close";
_s1.Close();
 //BA.debugLineNum = 138;BA.debugLine="Return l1";
if (true) return _l1;
 //BA.debugLineNum = 139;BA.debugLine="End Sub";
return null;
}
public static String  _playanimation(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ConcreteViewWrapper _obj1,String _saction,int _sspeed) throws Exception{
anywheresoftware.b4a.objects.AnimationWrapper _animation1 = null;
 //BA.debugLineNum = 9;BA.debugLine="Sub playAnimation(obj1 As View,sAction As String,s";
 //BA.debugLineNum = 10;BA.debugLine="Dim animation1 As Animation";
_animation1 = new anywheresoftware.b4a.objects.AnimationWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Select Case sAction";
switch (BA.switchObjectToInt(_saction,"rotate","scale","scale1","alpha","translate")) {
case 0:
 //BA.debugLineNum = 13;BA.debugLine="animation1.InitializeRotateCenter(\"\",0,360,obj1";
_animation1.InitializeRotateCenter(_ba,"",(float) (0),(float) (360),(android.view.View)(_obj1.getObject()));
 break;
case 1:
 //BA.debugLineNum = 15;BA.debugLine="animation1.InitializeScaleCenter(\"\",1,1,0.2,0.2";
_animation1.InitializeScaleCenter(_ba,"",(float) (1),(float) (1),(float) (0.2),(float) (0.2),(android.view.View)(_obj1.getObject()));
 break;
case 2:
 //BA.debugLineNum = 17;BA.debugLine="animation1.InitializeScaleCenter(\"\",-3,-3,0,0,o";
_animation1.InitializeScaleCenter(_ba,"",(float) (-3),(float) (-3),(float) (0),(float) (0),(android.view.View)(_obj1.getObject()));
 break;
case 3:
 //BA.debugLineNum = 19;BA.debugLine="animation1.InitializeAlpha(\"\",0,100)";
_animation1.InitializeAlpha(_ba,"",(float) (0),(float) (100));
 break;
case 4:
 //BA.debugLineNum = 21;BA.debugLine="animation1.InitializeTranslate(\"\",0,0,obj1.Left";
_animation1.InitializeTranslate(_ba,"",(float) (0),(float) (0),(float) (_obj1.getLeft()),(float) (_obj1.getTop()));
 break;
}
;
 //BA.debugLineNum = 23;BA.debugLine="animation1.RepeatCount = 0";
_animation1.setRepeatCount((int) (0));
 //BA.debugLineNum = 24;BA.debugLine="animation1.Duration = sSpeed";
_animation1.setDuration((long) (_sspeed));
 //BA.debugLineNum = 25;BA.debugLine="DoEvents";
anywheresoftware.b4a.keywords.Common.DoEvents();
 //BA.debugLineNum = 26;BA.debugLine="animation1.Start(obj1)";
_animation1.Start((android.view.View)(_obj1.getObject()));
 //BA.debugLineNum = 27;BA.debugLine="DoEvents";
anywheresoftware.b4a.keywords.Common.DoEvents();
 //BA.debugLineNum = 28;BA.debugLine="End Sub";
return "";
}
public static String  _playaudio(anywheresoftware.b4a.BA _ba,String _sfile) throws Exception{
 //BA.debugLineNum = 30;BA.debugLine="Sub playAudio(sFile As String)";
 //BA.debugLineNum = 31;BA.debugLine="Try";
try { //BA.debugLineNum = 32;BA.debugLine="mp1.Initialize2(\"\")";
_mp1.Initialize2((_ba.processBA == null ? _ba : _ba.processBA),"");
 //BA.debugLineNum = 33;BA.debugLine="mp1.load(File.DirAssets,sFile)";
_mp1.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_sfile);
 //BA.debugLineNum = 34;BA.debugLine="mp1.Play";
_mp1.Play();
 } 
       catch (Exception e29) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e29); //BA.debugLineNum = 36;BA.debugLine="Log(LastException.Message)";
anywheresoftware.b4a.keywords.Common.Log(anywheresoftware.b4a.keywords.Common.LastException(_ba).getMessage());
 };
 //BA.debugLineNum = 38;BA.debugLine="End Sub";
return "";
}
public static String  _playaudionumber(anywheresoftware.b4a.BA _ba,String _snumber) throws Exception{
String _sfilename = "";
anywheresoftware.b4a.objects.MediaPlayerWrapper _media = null;
anywheresoftware.b4a.agraham.threading.Threading _threat1 = null;
int _i = 0;
int _j = 0;
 //BA.debugLineNum = 40;BA.debugLine="Sub playAudioNumber(sNumber As String)";
 //BA.debugLineNum = 41;BA.debugLine="Dim sFilename As String";
_sfilename = "";
 //BA.debugLineNum = 42;BA.debugLine="Dim media As MediaPlayer";
_media = new anywheresoftware.b4a.objects.MediaPlayerWrapper();
 //BA.debugLineNum = 43;BA.debugLine="Dim threat1 As Thread";
_threat1 = new anywheresoftware.b4a.agraham.threading.Threading();
 //BA.debugLineNum = 44;BA.debugLine="Dim i,j As Int";
_i = 0;
_j = 0;
 //BA.debugLineNum = 45;BA.debugLine="threat1.Initialise(\"\")";
_threat1.Initialise((_ba.processBA == null ? _ba : _ba.processBA),"");
 //BA.debugLineNum = 46;BA.debugLine="Try";
try { //BA.debugLineNum = 47;BA.debugLine="media.Initialize2(\"mp2\")";
_media.Initialize2((_ba.processBA == null ? _ba : _ba.processBA),"mp2");
 //BA.debugLineNum = 48;BA.debugLine="If (sNumber Mod 10 = 0) Then";
if (((double)(Double.parseDouble(_snumber))%10==0)) { 
 //BA.debugLineNum = 49;BA.debugLine="sFilename = sNumber & \".mp3\"";
_sfilename = _snumber+".mp3";
 //BA.debugLineNum = 50;BA.debugLine="media.Load(File.DirAssets,\"fa_\" & sFilename)";
_media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"fa_"+_sfilename);
 //BA.debugLineNum = 51;BA.debugLine="media.Play";
_media.Play();
 //BA.debugLineNum = 52;BA.debugLine="Return";
if (true) return "";
 };
 //BA.debugLineNum = 54;BA.debugLine="If sNumber > 19 Then";
if ((double)(Double.parseDouble(_snumber))>19) { 
 //BA.debugLineNum = 55;BA.debugLine="i = sNumber Mod 10";
_i = (int) ((double)(Double.parseDouble(_snumber))%10);
 //BA.debugLineNum = 56;BA.debugLine="j = Floor((sNumber / 10)) * 10";
_j = (int) (anywheresoftware.b4a.keywords.Common.Floor(((double)(Double.parseDouble(_snumber))/(double)10))*10);
 //BA.debugLineNum = 57;BA.debugLine="sFilename = j & \"_.mp3\"";
_sfilename = BA.NumberToString(_j)+"_.mp3";
 //BA.debugLineNum = 58;BA.debugLine="media.Load(File.DirAssets,\"fa_\" & sFilename)";
_media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"fa_"+_sfilename);
 //BA.debugLineNum = 59;BA.debugLine="media.Play";
_media.Play();
 //BA.debugLineNum = 60;BA.debugLine="threat1.Sleep(700)";
_threat1.Sleep((int) (700));
 //BA.debugLineNum = 61;BA.debugLine="sFilename = i & \".mp3\"";
_sfilename = BA.NumberToString(_i)+".mp3";
 //BA.debugLineNum = 62;BA.debugLine="media.Load(File.DirAssets,\"fa_\" & sFilename)";
_media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"fa_"+_sfilename);
 //BA.debugLineNum = 63;BA.debugLine="media.Play";
_media.Play();
 }else {
 //BA.debugLineNum = 65;BA.debugLine="sFilename = \"fa_\" & sNumber & \".mp3\"";
_sfilename = "fa_"+_snumber+".mp3";
 //BA.debugLineNum = 66;BA.debugLine="media.Load(File.DirAssets, sFilename)";
_media.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),_sfilename);
 //BA.debugLineNum = 67;BA.debugLine="media.Play";
_media.Play();
 };
 } 
       catch (Exception e62) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e62); //BA.debugLineNum = 70;BA.debugLine="Msgbox(\"این قابلیت در نسخه بعدی فعال خواهد شد\",\"خ";
anywheresoftware.b4a.keywords.Common.Msgbox("این قابلیت در نسخه بعدی فعال خواهد شد","خطا",_ba);
 };
 //BA.debugLineNum = 72;BA.debugLine="End Sub";
return "";
}
public static String  _playbggame1(anywheresoftware.b4a.BA _ba) throws Exception{
String _s1 = "";
String _s2 = "";
 //BA.debugLineNum = 90;BA.debugLine="Sub playbgGame1";
 //BA.debugLineNum = 91;BA.debugLine="Try";
try { //BA.debugLineNum = 92;BA.debugLine="Dim s1,s2 As String";
_s1 = "";
_s2 = "";
 //BA.debugLineNum = 93;BA.debugLine="s1 = settings.getData(\"settingApp.app\",\"muteBG\")";
_s1 = mostCurrent._settings._getdata(_ba,"settingApp.app","muteBG");
 //BA.debugLineNum = 94;BA.debugLine="s2 = settings.getData(\"settingApp.app\",\"audioBG\")";
_s2 = mostCurrent._settings._getdata(_ba,"settingApp.app","audioBG");
 //BA.debugLineNum = 95;BA.debugLine="If s1 <> \"true\" Then";
if ((_s1).equals("true") == false) { 
 //BA.debugLineNum = 96;BA.debugLine="mpGame1.Initialize2(\"\")";
_mpgame1.Initialize2((_ba.processBA == null ? _ba : _ba.processBA),"");
 //BA.debugLineNum = 97;BA.debugLine="If s2 = \"\" Then";
if ((_s2).equals("")) { 
 //BA.debugLineNum = 98;BA.debugLine="mpGame1.load(File.DirAssets,\"bg.mp3\")";
_mpgame1.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"bg.mp3");
 }else if((_s2).equals("") == false && anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),_s2)==anywheresoftware.b4a.keywords.Common.True) { 
 //BA.debugLineNum = 100;BA.debugLine="mpGame1.load(File.DirInternal,s2)";
_mpgame1.Load(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),_s2);
 }else {
 //BA.debugLineNum = 102;BA.debugLine="mpGame1.load(File.DirAssets,\"bg.mp3\")";
_mpgame1.Load(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"bg.mp3");
 };
 //BA.debugLineNum = 104;BA.debugLine="mpGame1.Play";
_mpgame1.Play();
 };
 } 
       catch (Exception e99) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e99); //BA.debugLineNum = 107;BA.debugLine="Log(LastException.Message)";
anywheresoftware.b4a.keywords.Common.Log(anywheresoftware.b4a.keywords.Common.LastException(_ba).getMessage());
 };
 //BA.debugLineNum = 109;BA.debugLine="End Sub";
return "";
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 3;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 6;BA.debugLine="Dim mp1,mpGame1 As MediaPlayer";
_mp1 = new anywheresoftware.b4a.objects.MediaPlayerWrapper();
_mpgame1 = new anywheresoftware.b4a.objects.MediaPlayerWrapper();
 //BA.debugLineNum = 7;BA.debugLine="End Sub";
return "";
}
public static String  _shufflearray(anywheresoftware.b4a.BA _ba,String[] _arr) throws Exception{
int _n = 0;
int _r = 0;
String _t = "";
int _i = 0;
 //BA.debugLineNum = 110;BA.debugLine="Sub ShuffleArray(arr() As String)";
 //BA.debugLineNum = 111;BA.debugLine="Dim n As Int = arr.Length-1";
_n = (int) (_arr.length-1);
 //BA.debugLineNum = 112;BA.debugLine="Dim r As Int";
_r = 0;
 //BA.debugLineNum = 113;BA.debugLine="Dim t As String";
_t = "";
 //BA.debugLineNum = 114;BA.debugLine="For i = 0 To n - 1";
{
final int step106 = 1;
final int limit106 = (int) (_n-1);
for (_i = (int) (0); (step106 > 0 && _i <= limit106) || (step106 < 0 && _i >= limit106); _i = ((int)(0 + _i + step106))) {
 //BA.debugLineNum = 115;BA.debugLine="r = Rnd(i, n)";
_r = anywheresoftware.b4a.keywords.Common.Rnd(_i,_n);
 //BA.debugLineNum = 116;BA.debugLine="t = arr(i)";
_t = _arr[_i];
 //BA.debugLineNum = 117;BA.debugLine="arr(i) = arr(r)";
_arr[_i] = _arr[_r];
 //BA.debugLineNum = 118;BA.debugLine="arr(r) = t";
_arr[_r] = _t;
 }
};
 //BA.debugLineNum = 120;BA.debugLine="End Sub";
return "";
}
public static String  _stopaudio(anywheresoftware.b4a.BA _ba) throws Exception{
 //BA.debugLineNum = 84;BA.debugLine="Sub stopAudio";
 //BA.debugLineNum = 85;BA.debugLine="Try";
try { //BA.debugLineNum = 86;BA.debugLine="mpGame1.Stop";
_mpgame1.Stop();
 } 
       catch (Exception e80) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e80); };
 //BA.debugLineNum = 89;BA.debugLine="End Sub";
return "";
}
public static String  _vibrephone(anywheresoftware.b4a.BA _ba) throws Exception{
anywheresoftware.b4a.phone.Phone.PhoneVibrate _i1 = null;
 //BA.debugLineNum = 80;BA.debugLine="Sub vibrePhone";
 //BA.debugLineNum = 81;BA.debugLine="Dim i1 As PhoneVibrate";
_i1 = new anywheresoftware.b4a.phone.Phone.PhoneVibrate();
 //BA.debugLineNum = 82;BA.debugLine="i1.Vibrate(1100)";
_i1.Vibrate((_ba.processBA == null ? _ba : _ba.processBA),(long) (1100));
 //BA.debugLineNum = 83;BA.debugLine="End Sub";
return "";
}
}
