Exemple #1
0
        /// <summary>
        /// Функция обновления содержимого UnitPresenter,
        /// использует содержимое Features.cs, tm.cs
        /// </summary>
        internal void Update()
        {
            Position.Update();

            if (original.UnitType == GameEngine.Characters.UnitType.Infantry)
            {
                UnitType = "Пехота";
            }
            else if (original.UnitType == GameEngine.Characters.UnitType.Armor)
            {
                UnitType = "Танковые войска";
            }
            else if (original.UnitType == GameEngine.Characters.UnitType.Engineers)
            {
                UnitType = "Инженерные войска";
            }
            else if (original.UnitType == GameEngine.Characters.UnitType.Artillery)
            {
                UnitType = "Артиллерия";
            }
            else if (original.UnitType == GameEngine.Characters.UnitType.AirForce)
            {
                UnitType = "Авиация";
            }
            else if (original.UnitType == GameEngine.Characters.UnitType.Cavalry)
            {
                UnitType = "Кавалерия";
            }
            else if (original.UnitType == GameEngine.Characters.UnitType.Navy)
            {
                UnitType = "Флот";
            }

            if (original.AuthorizedStrength != 0)
            {
                PercentageAliveAndAmmo = ((int)((double)original.Properties.AllCount() / original.AuthorizedStrength * 100)).ToString() + "%/" + ((int)((double)original.Properties.AmunitionCount() / original.AuthorizedAmmo * 100)).ToString() + "%";
            }
            else
            {
                PercentageAliveAndAmmo = "";
            }
            //original
            AllPersonnel    = original.Properties.AllCount();
            ActivePersonnel = original.Properties.ActiveCount();
            WeaponsCount    = original.Properties.HeavyWeaponCount();
            Speed           = (original.Properties.CurSpeed * 10).ToString() + " км/ч";
            CaliberCount    = GetCaliberCount();
            DefendCaliber   = GetCaliberDefend();
            Ammo            = original.Properties.AmunitionCount();

            IsMyUnit = original.Side.TeamNumber == Game.PlayerTeam;

            //Передача данных для отображения действия
            if (original.CurrentAction != null && original.CurrentAction is MoveAction)
            {
                CurrentAction = new OrderPresenter(original.CurrentAction, original.Position);
            }
        }
        /// <summary>
        /// Функция обновления содержимого UnitPresenter,
        /// использует содержимое Features.cs, tm.cs
        /// </summary>
        internal void Update()
        {
            Position.Update();

            if (original.UnitType == GameEngine.Characters.UnitType.Infantry)
                UnitType = "Пехота";
            else if (original.UnitType == GameEngine.Characters.UnitType.Armor)
                UnitType = "Танковые войска";
            else if (original.UnitType == GameEngine.Characters.UnitType.Engineers)
                UnitType = "Инженерные войска";
            else if (original.UnitType == GameEngine.Characters.UnitType.Artillery)
                UnitType = "Артиллерия";
            else if (original.UnitType == GameEngine.Characters.UnitType.AirForce)
                UnitType = "Авиация";
            else if (original.UnitType == GameEngine.Characters.UnitType.Cavalry)
                UnitType = "Кавалерия";
            else if (original.UnitType == GameEngine.Characters.UnitType.Navy)
                UnitType = "Флот";

            if (original.AuthorizedStrength != 0)
                PercentageAliveAndAmmo = ((int)((double)original.Properties.AllCount() / original.AuthorizedStrength * 100)).ToString() + "%/" + ((int)((double)original.Properties.AmunitionCount() / original.AuthorizedAmmo * 100)).ToString() + "%";
            else PercentageAliveAndAmmo = "";
            //original
            AllPersonnel=original.Properties.AllCount();
            ActivePersonnel = original.Properties.ActiveCount();
            WeaponsCount = original.Properties.HeavyWeaponCount();
            Speed = (original.Properties.CurSpeed * 10).ToString() + " км/ч";
            CaliberCount = GetCaliberCount();
            DefendCaliber = GetCaliberDefend();
            Ammo = original.Properties.AmunitionCount();

            IsMyUnit = original.Side.TeamNumber == Game.PlayerTeam;

            //Передача данных для отображения действия
            if (original.CurrentAction != null && original.CurrentAction is MoveAction)
                CurrentAction = new OrderPresenter(original.CurrentAction, original.Position);
        }