Esempio n. 1
0
        /// <summary>
        /// Конструктор класса.
        /// </summary>
        /// <param name="panel">Созданная и инициализированная
        /// панель настройки действия.</param>
        public ActionPropertiesDialog(IActionPanel panel)
        {
            if (panel == null)
                throw new ArgumentNullException("aPanel");

            InitializeComponent();

            _actionSettingPanel = panel;
            propertiesPanel.Controls.Add(_actionSettingPanel as AbstractActionPanel);
            (_actionSettingPanel as AbstractActionPanel).Dock = DockStyle.Fill;

            _actionSettingPanel.ActionStatusChanged += new EventHandler(actionSettingPanel_ActionStatusChanged);
            okButton.Enabled = _actionSettingPanel.IsActionReady;

            Text = _actionSettingPanel.LocalizedCaption;
        }
Esempio n. 2
0
        public UIContainer(IFormationPanel formationPanel,
                           ITargetPanel targetPanel,
                           ICommandPanel commandPanel,
                           IActionPanel actionPanel,
                           ITurnOrderPanel turnOrderPanel,
                           IActionDetailsPanel actionDetailsPanel,
                           ICategoryDetailsPanel categoryDetailsPanel,
                           ICombatLogPanel combatLogPanel,
                           ICharacterPanel characterPanel,
                           IStatusEffectsPanel statusEffectsPanel,
                           IStatsDetailsPanel statsDetailsPanel,
                           ICategoryPanel categoryPanel,
                           IUIStateTracker uiStateTracker,
                           IUICharacterManager uiCharacterManager,
                           ScreenBuffer screenBuffer)
        {
            _formationPanel           = formationPanel;
            _targetPanel              = targetPanel;
            _commandPanel             = commandPanel;
            _actionPanel              = actionPanel;
            _turnOrderPanel           = turnOrderPanel;
            _actionDetailsPanel       = actionDetailsPanel;
            _categoryDetailsPanel     = categoryDetailsPanel;
            _combatLogPanel           = combatLogPanel;
            _characterPanel           = characterPanel;
            _statusEffectsPanel       = statusEffectsPanel;
            _statsDetailsPanel        = statsDetailsPanel;
            _categoryPanel            = categoryPanel;
            _characterPanel.MaxHeight = _formationPanel.MaxHeight;
            _uiStateTracker           = uiStateTracker;
            _uiCharacterManager       = uiCharacterManager;
            _screenBuffer             = screenBuffer;
            _commandPanel.IsActive    = true;

            BindEvents();
        }
Esempio n. 3
0
        private void SetupAndDoAction(IActionPanel anActionPanel)
        {
            ActionPropertiesDialog dialog
                = new ActionPropertiesDialog(anActionPanel);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                IAction action = dialog.Action;

                List<Node> nodes = new List<Node>();
                foreach (TreeNodeAdv treeNode in mainTreeView.SelectedNodes)
                    nodes.Add(treeNode.Tag as Node);

                ICollection<IComputer> computers =
                    NodeTransformer.ConvertToUniquePlainList(nodes);

                foreach (IComputer computer in computers)
                    if (computer.IsOperational)
                        action.DoAction(computer.Host);
            }
        }