Пример #1
0
        /// <summary>
        /// Retourne une vue vers le héros contrôlé par ce contrôleur.
        /// </summary>
        public EntityBaseView GetMyHero()
        {
            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)21).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);
            EntityBaseView         returnValue = EntityBaseView.Deserialize(input);

            return((EntityBaseView)returnValue);
        }
Пример #2
0
        /// <summary>
        /// Retourne la liste des entités en vue
        /// </summary>
        public List <EntityBaseView> GetEntitiesInSight()
        {
            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)28).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 <EntityBaseView>  returnValue = new List <EntityBaseView>();
            int returnValue_count = Int32.Parse(input.ReadLine());

            for (int returnValue_i = 0; returnValue_i < returnValue_count; returnValue_i++)
            {
                EntityBaseView returnValue_e = EntityBaseView.Deserialize(input);
                returnValue.Add((EntityBaseView)returnValue_e);
            }
            return((List <EntityBaseView>)returnValue);
        }
Пример #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);
        }
Пример #4
0
        public static EntityBaseView Deserialize(System.IO.StreamReader input)
        {
            EntityBaseView _obj = new EntityBaseView();
            // GetMagicResist
            float _obj_GetMagicResist = Single.Parse(input.ReadLine());

            _obj.GetMagicResist = (float)_obj_GetMagicResist;
            // GetAbilityPower
            float _obj_GetAbilityPower = Single.Parse(input.ReadLine());

            _obj.GetAbilityPower = (float)_obj_GetAbilityPower;
            // GetCooldownReduction
            float _obj_GetCooldownReduction = Single.Parse(input.ReadLine());

            _obj.GetCooldownReduction = (float)_obj_GetCooldownReduction;
            // GetMoveSpeed
            float _obj_GetMoveSpeed = Single.Parse(input.ReadLine());

            _obj.GetMoveSpeed = (float)_obj_GetMoveSpeed;
            // GetAttackSpeed
            float _obj_GetAttackSpeed = Single.Parse(input.ReadLine());

            _obj.GetAttackSpeed = (float)_obj_GetAttackSpeed;
            // GetHPRegen
            float _obj_GetHPRegen = Single.Parse(input.ReadLine());

            _obj.GetHPRegen = (float)_obj_GetHPRegen;
            // GetAttackDamage
            float _obj_GetAttackDamage = Single.Parse(input.ReadLine());

            _obj.GetAttackDamage = (float)_obj_GetAttackDamage;
            // GetArmor
            float _obj_GetArmor = Single.Parse(input.ReadLine());

            _obj.GetArmor = (float)_obj_GetArmor;
            // GetHP
            float _obj_GetHP = Single.Parse(input.ReadLine());

            _obj.GetHP = (float)_obj_GetHP;
            // GetMaxHP
            float _obj_GetMaxHP = Single.Parse(input.ReadLine());

            _obj.GetMaxHP = (float)_obj_GetMaxHP;
            // UniquePassiveLevel
            int _obj_UniquePassiveLevel = Int32.Parse(input.ReadLine());

            _obj.UniquePassiveLevel = (int)_obj_UniquePassiveLevel;
            // UniquePassive
            EntityUniquePassives _obj_UniquePassive = (EntityUniquePassives)Int32.Parse(input.ReadLine());

            _obj.UniquePassive = (EntityUniquePassives)_obj_UniquePassive;
            // Role
            EntityHeroRole _obj_Role = (EntityHeroRole)Int32.Parse(input.ReadLine());

            _obj.Role = (EntityHeroRole)_obj_Role;
            // BaseArmor
            float _obj_BaseArmor = Single.Parse(input.ReadLine());

            _obj.BaseArmor = (float)_obj_BaseArmor;
            // Direction
            Vector2 _obj_Direction = Vector2.Deserialize(input);

            _obj.Direction = (Vector2)_obj_Direction;
            // Position
            Vector2 _obj_Position = Vector2.Deserialize(input);

            _obj.Position = (Vector2)_obj_Position;
            // ShieldPoints
            float _obj_ShieldPoints = Single.Parse(input.ReadLine());

            _obj.ShieldPoints = (float)_obj_ShieldPoints;
            // HP
            float _obj_HP = Single.Parse(input.ReadLine());

            _obj.HP = (float)_obj_HP;
            // BaseHPRegen
            float _obj_BaseHPRegen = Single.Parse(input.ReadLine());

            _obj.BaseHPRegen = (float)_obj_BaseHPRegen;
            // BaseMaxHP
            float _obj_BaseMaxHP = Single.Parse(input.ReadLine());

            _obj.BaseMaxHP = (float)_obj_BaseMaxHP;
            // BaseMoveSpeed
            float _obj_BaseMoveSpeed = Single.Parse(input.ReadLine());

            _obj.BaseMoveSpeed = (float)_obj_BaseMoveSpeed;
            // IsDead
            bool _obj_IsDead = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsDead = (bool)_obj_IsDead;
            // Type
            EntityTypeRelative _obj_Type = (EntityTypeRelative)Int32.Parse(input.ReadLine());

            _obj.Type = (EntityTypeRelative)_obj_Type;
            // ID
            int _obj_ID = Int32.Parse(input.ReadLine());

            _obj.ID = (int)_obj_ID;
            // BaseAttackDamage
            float _obj_BaseAttackDamage = Single.Parse(input.ReadLine());

            _obj.BaseAttackDamage = (float)_obj_BaseAttackDamage;
            // BaseCooldownReduction
            float _obj_BaseCooldownReduction = Single.Parse(input.ReadLine());

            _obj.BaseCooldownReduction = (float)_obj_BaseCooldownReduction;
            // BaseAttackSpeed
            float _obj_BaseAttackSpeed = Single.Parse(input.ReadLine());

            _obj.BaseAttackSpeed = (float)_obj_BaseAttackSpeed;
            // BaseAbilityPower
            float _obj_BaseAbilityPower = Single.Parse(input.ReadLine());

            _obj.BaseAbilityPower = (float)_obj_BaseAbilityPower;
            // BaseMagicResist
            float _obj_BaseMagicResist = Single.Parse(input.ReadLine());

            _obj.BaseMagicResist = (float)_obj_BaseMagicResist;
            // IsRooted
            bool _obj_IsRooted = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsRooted = (bool)_obj_IsRooted;
            // IsSilenced
            bool _obj_IsSilenced = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsSilenced = (bool)_obj_IsSilenced;
            // IsStuned
            bool _obj_IsStuned = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsStuned = (bool)_obj_IsStuned;
            // IsDamageImmune
            bool _obj_IsDamageImmune = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsDamageImmune = (bool)_obj_IsDamageImmune;
            // IsControlImmune
            bool _obj_IsControlImmune = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsControlImmune = (bool)_obj_IsControlImmune;
            // IsBlind
            bool _obj_IsBlind = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsBlind = (bool)_obj_IsBlind;
            // IsStealthed
            bool _obj_IsStealthed = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.IsStealthed = (bool)_obj_IsStealthed;
            // HasTrueVision
            bool _obj_HasTrueVision = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.HasTrueVision = (bool)_obj_HasTrueVision;
            // HasWardVision
            bool _obj_HasWardVision = Int32.Parse(input.ReadLine()) == 0 ? false : true;

            _obj.HasWardVision = (bool)_obj_HasWardVision;
            // VisionRange
            float _obj_VisionRange = Single.Parse(input.ReadLine());

            _obj.VisionRange = (float)_obj_VisionRange;
            return(_obj);
        }