Exemplo n.º 1
0
 public void OnLoad(string data)
 {
     //stats = JsonUtility.FromJson<PlayerStats>(data);
     enemyData = JsonUtility.FromJson <EData>(data);
     active    = enemyData.isActive;
     gameObject.SetActive(active);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Saves currentData (automatically called in OnApplicationQuit).
 /// </summary>
 public void Save()
 {
     EData.Save(Path.Combine(dataAssetFolderPath, playerDataFileName), Encoding.UTF8.GetBytes(JsonUtility.ToJson(currentData)));
     if (OnSaved != null)
     {
         OnSaved(currentData);
     }
 }
Exemplo n.º 3
0
        public AData(EData eData)
        {
            Rechnen rechnen = new Rechnen();

            this.aWurfweite       = rechnen.WurfWeite(eData.eV0, eData.eWinkel).ToString();
            this.aMaxHoehe        = rechnen.MaxHoehe(eData.eV0, eData.eWinkel).ToString();
            this.aZeit            = rechnen.Zeit(eData.eV0, eData.eWinkel).ToString();
            this.aGeschwindigkeit = rechnen.Geschwindigkeit(eData.eV0, eData.eWinkel, eData.eZeit).ToString();
            this.aEntfehrnung     = rechnen.Entfehrnung(eData.eV0, eData.eWinkel, eData.eZeit).ToString();
            this.aHoehe           = rechnen.Hoehe(eData.eV0, eData.eWinkel, eData.eZeit).ToString();
        }
Exemplo n.º 4
0
        public int unpack_data(EData _id, uint _map_data)
        {
            bit_field bf = m_data[( int )_id];

            if (bf.valid())
            {
                return(bf.unpack(_map_data));
            }

            return(-1);
        }
Exemplo n.º 5
0
        public uint pack_data(EData _id, int _val, uint _map_data)
        {
            bit_field bf = m_data[( int )_id];

            if (bf.valid())
            {
                return((~bf.mask(true) & _map_data) | bf.pack(_val));
            }

            return(0xffffffff);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Loads currentData from file (automatically called when class instance is initialized).
 /// </summary>
 public void Load()
 {
     currentData = JsonUtility.FromJson <PlayerData>(Encoding.UTF8.GetString(EData.Load(Path.Combine(dataAssetFolderPath, playerDataFileName))));
     if (currentData == null)
     {
         currentData = new PlayerData();
     }
     if (OnLoaded != null)
     {
         OnLoaded(currentData);
     }
 }
Exemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <int>   needSetVid = new List <int>();
            List <int>   existVid   = new List <int>();
            List <int>   insertVid  = new List <int>();
            DialogResult dr         = ofd_red.ShowDialog();

            if (dr.Equals(DialogResult.OK))
            {
                //StreamReader sr = new StreamReader(ofd_red.FileName, Encoding.Default);
                DataTable dt = new DataTable();
                using (Stream s = File.OpenRead(ofd_red.FileName))
                {
                    dt = ExeclNopiHelper.ReadExceleByStream(s);
                }
                List <EData> plateOList = new List <EData>();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    EData ed = new EData();
                    ed.ID     = (dt.Rows[i]).ItemArray[0].ToString().Trim();
                    ed.VPlate = (dt.Rows[i]).ItemArray[1].ToString().Trim();
                    ed.VTime  = (dt.Rows[i]).ItemArray[0].ToString().Trim();
                    plateOList.Add(ed);
                }
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < plateOList.Count; i++)
                {
                    if (!string.IsNullOrWhiteSpace(plateOList[i].VPlate))
                    {
                        sb.AppendFormat(" SELECT ID FROM dbo.Vehicle WHERE Plate LIKE '%{0}%' union", plateOList[i].VPlate);
                        sb.AppendLine();
                        if (i == plateOList.Count - 1)
                        {
                            sb.AppendFormat(" SELECT ID FROM dbo.Vehicle WHERE Plate LIKE '%{0}%' ", plateOList[i]);
                            sb.AppendLine();
                        }
                    }
                }

                using (zyt_basegpsEntities db = new zyt_basegpsEntities())
                {
                    needSetVid = db.Database.SqlQuery <int>(sb.ToString()).ToList();
                }
            }
        }
Exemplo n.º 8
0
        //conectarse

        public static bool  GetPostToken(string carnet, string clave)
        {
            bool band = false;
            //Lista de valores a pasar
            var values = new Dictionary <string, string>
            {
                { "UserName", carnet },
                { "Password", clave }
                //{ "Password", "Managua.2020" }
            };

            //Formato json
            var content = new FormUrlEncodedContent(values);

            //Realizamos la peticion via Post
            var response = client.PostAsync("https://sigi.unan.edu.ni/RAServices/Api/Autorizacion/Login", content);


            //MessageBox.Show(response.Result.ToString());
            try
            {
                //MessageBox.Show(response.Result.Content.ReadAsStringAsync().Result);
                string status = response.Result.StatusCode.ToString();
                if (status == "OK")
                {
                    LoginResult = Newtonsoft.Json.JsonConvert.DeserializeObject <EData>(response.Result.Content.ReadAsStringAsync().Result);
                    if (LoginResult.tokenDelUsuario.Length > 0)
                    {
                        band = true;
                    }
                }
                else
                {
                    error = "Hubo un error con el servidor!. \n Code: " + status + "\n Vuelva a intentarlo mas tarde";
                }
            }
            catch (Exception ex)
            {
                error = "Hubo un error:\n" + ex.HResult + "\r" + ex.InnerException.Message.ToString() + "\nVerifique sus datos. \nVerifique su conexión a internet y vuelva a intentarlo";
            }



            return(band);
        }
Exemplo n.º 9
0
 public Data getData(EData e)
 {
     return(_dataList[Convert.ToInt32(e)]);
 }
Exemplo n.º 10
0
 protected virtual void OnData(DataEventArgs data)
 {
     EData?.Invoke(this, data);
 }
Exemplo n.º 11
0
 public bit_field get_bit_field(EData _type)
 {
     return(m_data[( int )_type]);
 }
Exemplo n.º 12
0
 public static int staticTest(DateTime now, Interface interface1, int?number = 100, string data = "summa", EData eDatauser = EData.Pass)
 {
     return(number.GetValueOrDefault() * 10);
 }