Пример #1
0
        public int GetShortcutIndexOf(SiegeWeapon weapon)
        {
            int num1;

            switch (SiegeWeaponController.GetSideOf(weapon))
            {
            case FormationAI.BehaviorSide.Left:
                num1 = 1;
                break;

            case FormationAI.BehaviorSide.Right:
                num1 = 2;
                break;

            default:
                num1 = 0;
                break;
            }
            int num2 = num1;

            if (!(weapon is IPrimarySiegeWeapon))
            {
                num2 += 3;
            }
            return(num2);
        }
Пример #2
0
        public void Select(SiegeWeapon weapon)
        {
            if (this.SelectedWeapons.Contains(weapon) || !SiegeWeaponController.IsWeaponSelectable(weapon))
            {
                return;
            }
            if (GameNetwork.IsClient)
            {
                GameNetwork.BeginModuleEventAsClient();
                GameNetwork.WriteMessage((GameNetworkMessage) new SelectSiegeWeapon(weapon));
                GameNetwork.EndModuleEventAsClient();
            }
            this._selectedWeapons.Add(weapon);
            Action siegeWeaponsChanged = this.OnSelectedSiegeWeaponsChanged;

            if (siegeWeaponsChanged == null)
            {
                return;
            }
            siegeWeaponsChanged();
        }