예제 #1
0
        /// <summary>
        /// Obtient une vue sur le spell du héros contrôlé dont l'id est passé en paramètre. (soit 0 soit 1)
        /// </summary>
        public SpellView GetMySpell(int spellId)
        {
            System.IO.MemoryStream s      = new System.IO.MemoryStream();
            System.IO.StreamWriter output = new System.IO.StreamWriter(s, BOMLESS_UTF8);
            output.NewLine = "\n";
            output.WriteLine(((int)40).ToString());
            output.WriteLine(((int)spellId).ToString());
            output.Close();
            TCPHelper.Send(s.ToArray());
            byte[] response = TCPHelper.Receive();
            s = new System.IO.MemoryStream(response);
            System.IO.StreamReader input = new System.IO.StreamReader(s, BOMLESS_UTF8);
            SpellView returnValue        = SpellView.Deserialize(input);

            return((SpellView)returnValue);
        }
예제 #2
0
        public static SpellView Deserialize(System.IO.StreamReader input)
        {
            SpellView _obj = new SpellView();
            // CurrentCooldown
            float _obj_CurrentCooldown = Single.Parse(input.ReadLine());

            _obj.CurrentCooldown = (float)_obj_CurrentCooldown;
            // SourceCaster
            int _obj_SourceCaster = Int32.Parse(input.ReadLine());

            _obj.SourceCaster = (int)_obj_SourceCaster;
            // Model
            int _obj_Model = Int32.Parse(input.ReadLine());

            _obj.Model = (int)_obj_Model;
            // Level
            int _obj_Level = Int32.Parse(input.ReadLine());

            _obj.Level = (int)_obj_Level;
            return(_obj);
        }