Exemplo n.º 1
0
        /// <summary>
        /// Obtient la liste des modèles d'armes disponibles au shop.
        /// </summary>
        public List <WeaponModelView> ShopGetWeapons()
        {
            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)9).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);
            List <WeaponModelView> returnValue = new List <WeaponModelView>();
            int returnValue_count = Int32.Parse(input.ReadLine());

            for (int returnValue_i = 0; returnValue_i < returnValue_count; returnValue_i++)
            {
                WeaponModelView returnValue_e = WeaponModelView.Deserialize(input);
                returnValue.Add((WeaponModelView)returnValue_e);
            }
            return((List <WeaponModelView>)returnValue);
        }
Exemplo n.º 2
0
        public static WeaponModelView Deserialize(System.IO.StreamReader input)
        {
            WeaponModelView _obj = new WeaponModelView();
            // ID
            int _obj_ID = Int32.Parse(input.ReadLine());

            _obj.ID = (int)_obj_ID;
            // Upgrades
            List <WeaponUpgradeModelView> _obj_Upgrades = new List <WeaponUpgradeModelView>();
            int _obj_Upgrades_count = Int32.Parse(input.ReadLine());

            for (int _obj_Upgrades_i = 0; _obj_Upgrades_i < _obj_Upgrades_count; _obj_Upgrades_i++)
            {
                WeaponUpgradeModelView _obj_Upgrades_e = WeaponUpgradeModelView.Deserialize(input);
                _obj_Upgrades.Add((WeaponUpgradeModelView)_obj_Upgrades_e);
            }
            _obj.Upgrades = (List <WeaponUpgradeModelView>)_obj_Upgrades;
            // Price
            float _obj_Price = Single.Parse(input.ReadLine());

            _obj.Price = (float)_obj_Price;
            return(_obj);
        }
Exemplo n.º 3
0
        public static GameStaticDataView Deserialize(System.IO.StreamReader input)
        {
            GameStaticDataView _obj = new GameStaticDataView();
            // CampsPositions
            List <Vector2> _obj_CampsPositions       = new List <Vector2>();
            int            _obj_CampsPositions_count = Int32.Parse(input.ReadLine());

            for (int _obj_CampsPositions_i = 0; _obj_CampsPositions_i < _obj_CampsPositions_count; _obj_CampsPositions_i++)
            {
                Vector2 _obj_CampsPositions_e = Vector2.Deserialize(input);
                _obj_CampsPositions.Add((Vector2)_obj_CampsPositions_e);
            }
            _obj.CampsPositions = (List <Vector2>)_obj_CampsPositions;
            // RouterPositions
            List <Vector2> _obj_RouterPositions       = new List <Vector2>();
            int            _obj_RouterPositions_count = Int32.Parse(input.ReadLine());

            for (int _obj_RouterPositions_i = 0; _obj_RouterPositions_i < _obj_RouterPositions_count; _obj_RouterPositions_i++)
            {
                Vector2 _obj_RouterPositions_e = Vector2.Deserialize(input);
                _obj_RouterPositions.Add((Vector2)_obj_RouterPositions_e);
            }
            _obj.RouterPositions = (List <Vector2>)_obj_RouterPositions;
            // VirusCheckpoints
            List <EntityBaseView> _obj_VirusCheckpoints = new List <EntityBaseView>();
            int _obj_VirusCheckpoints_count             = Int32.Parse(input.ReadLine());

            for (int _obj_VirusCheckpoints_i = 0; _obj_VirusCheckpoints_i < _obj_VirusCheckpoints_count; _obj_VirusCheckpoints_i++)
            {
                EntityBaseView _obj_VirusCheckpoints_e = EntityBaseView.Deserialize(input);
                _obj_VirusCheckpoints.Add((EntityBaseView)_obj_VirusCheckpoints_e);
            }
            _obj.VirusCheckpoints = (List <EntityBaseView>)_obj_VirusCheckpoints;
            // Weapons
            List <WeaponModelView> _obj_Weapons = new List <WeaponModelView>();
            int _obj_Weapons_count = Int32.Parse(input.ReadLine());

            for (int _obj_Weapons_i = 0; _obj_Weapons_i < _obj_Weapons_count; _obj_Weapons_i++)
            {
                WeaponModelView _obj_Weapons_e = WeaponModelView.Deserialize(input);
                _obj_Weapons.Add((WeaponModelView)_obj_Weapons_e);
            }
            _obj.Weapons = (List <WeaponModelView>)_obj_Weapons;
            // Armors
            List <PassiveEquipmentModelView> _obj_Armors = new List <PassiveEquipmentModelView>();
            int _obj_Armors_count = Int32.Parse(input.ReadLine());

            for (int _obj_Armors_i = 0; _obj_Armors_i < _obj_Armors_count; _obj_Armors_i++)
            {
                PassiveEquipmentModelView _obj_Armors_e = PassiveEquipmentModelView.Deserialize(input);
                _obj_Armors.Add((PassiveEquipmentModelView)_obj_Armors_e);
            }
            _obj.Armors = (List <PassiveEquipmentModelView>)_obj_Armors;
            // Boots
            List <PassiveEquipmentModelView> _obj_Boots = new List <PassiveEquipmentModelView>();
            int _obj_Boots_count = Int32.Parse(input.ReadLine());

            for (int _obj_Boots_i = 0; _obj_Boots_i < _obj_Boots_count; _obj_Boots_i++)
            {
                PassiveEquipmentModelView _obj_Boots_e = PassiveEquipmentModelView.Deserialize(input);
                _obj_Boots.Add((PassiveEquipmentModelView)_obj_Boots_e);
            }
            _obj.Boots = (List <PassiveEquipmentModelView>)_obj_Boots;
            // Enchants
            List <WeaponEnchantModelView> _obj_Enchants = new List <WeaponEnchantModelView>();
            int _obj_Enchants_count = Int32.Parse(input.ReadLine());

            for (int _obj_Enchants_i = 0; _obj_Enchants_i < _obj_Enchants_count; _obj_Enchants_i++)
            {
                WeaponEnchantModelView _obj_Enchants_e = WeaponEnchantModelView.Deserialize(input);
                _obj_Enchants.Add((WeaponEnchantModelView)_obj_Enchants_e);
            }
            _obj.Enchants = (List <WeaponEnchantModelView>)_obj_Enchants;
            // Spells
            List <SpellModelView> _obj_Spells = new List <SpellModelView>();
            int _obj_Spells_count             = Int32.Parse(input.ReadLine());

            for (int _obj_Spells_i = 0; _obj_Spells_i < _obj_Spells_count; _obj_Spells_i++)
            {
                SpellModelView _obj_Spells_e = SpellModelView.Deserialize(input);
                _obj_Spells.Add((SpellModelView)_obj_Spells_e);
            }
            _obj.Spells = (List <SpellModelView>)_obj_Spells;
            // Structures
            List <EntityBaseView> _obj_Structures = new List <EntityBaseView>();
            int _obj_Structures_count             = Int32.Parse(input.ReadLine());

            for (int _obj_Structures_i = 0; _obj_Structures_i < _obj_Structures_count; _obj_Structures_i++)
            {
                EntityBaseView _obj_Structures_e = EntityBaseView.Deserialize(input);
                _obj_Structures.Add((EntityBaseView)_obj_Structures_e);
            }
            _obj.Structures = (List <EntityBaseView>)_obj_Structures;
            // Map
            MapView _obj_Map = MapView.Deserialize(input);

            _obj.Map = (MapView)_obj_Map;
            return(_obj);
        }