コード例 #1
0
ファイル: StateManager.cs プロジェクト: microm/eplib
        public void ChangeState(StateType type)
        {
            if (EditPanel.LayerInfo == null)
                return;

            switch (type)
            {
                case StateType.CreateButton:
                    m_currentState = new CreateControlState(new CreateButton(m_editPanel), this, m_commandManager);
                    break;
                case StateType.CreateLabel:
                    m_currentState = new CreateControlState(new CreateLabel(m_editPanel), this, m_commandManager);
                    break;
                case StateType.CreatePanel:
                    m_currentState = new CreateControlState(new CreatePanel(m_editPanel), this, m_commandManager);
                    break;
                case StateType.Move:
                    m_currentState = new MoveState(m_editPanel.SelectedControls, this, m_commandManager);
                    break;
                case StateType.Resize:
                    m_currentState = new ResizeControlState(m_editPanel.SelectedControls, this, m_commandManager, m_flagPosition);
                    break;
                case StateType.Idle:
                    m_currentState = new IdleState(m_editPanel, this, m_commandManager);
                    break;
            }
        }
コード例 #2
0
ファイル: StateManager.cs プロジェクト: microm/eplib
        public StateManager(CommandManager commandManager, StageBox editor)
        {
            m_commandManager = commandManager;
            m_editPanel = editor;

            m_currentState = new IdleState(m_editPanel, this, m_commandManager);
        }