Ejemplo n.º 1
0
        private void OnOrderButtonClicked(object sender, RoutedEventArgs e)
        {
            CombatOrder order = CombatOrder.Retreat;

            if (sender == EngageButton)
            {
                order = CombatOrder.Engage;
            }
            if (sender == TransportsButton)
            {
                order = CombatOrder.Transports;
            }
            if (sender == FormationButton)
            {
                order = CombatOrder.Formation;
            }
            if (sender == RushButton)
            {
                order = CombatOrder.Rush;
            }
            if (sender == HailButton)
            {
                order = CombatOrder.Hail;
            }

            GameLog.Client.Combat.DebugFormat("{0} button clicked by player", order);

            UpperButtonsPanel.IsEnabled = false;
            LowerButtonsPanel.IsEnabled = false;
            // send targets before order - order updates
            ClientCommands.SendCombatTarget1.Execute(CombatHelper.GenerateBlanketTargetPrimary(_playerAssets, _theTargeted1Civ));
            ClientCommands.SendCombatTarget2.Execute(CombatHelper.GenerateBlanketTargetSecondary(_playerAssets, _theTargeted2Civ));
            ClientCommands.SendCombatOrders.Execute(CombatHelper.GenerateBlanketOrders(_playerAssets, order));
        }