示例#1
0
 internal TileBrushCollection(TileBrushCollection tileBrushCollection)
 {
     m_tileBrushes = new List <TileBrush>();
     foreach (TileBrush tileBrush in tileBrushCollection.TileBrushes)
     {
         m_tileBrushes.Add(new TileBrush(tileBrush));
     }
 }
示例#2
0
文件: MainForm.cs 项目: dekk7/xEngine
        public MainForm(string[] arguments)
        {
            InitializeComponent();

            m_arguments = arguments;

            m_commandHistory = CommandHistory.Instance;
            m_tileBrushCollection = new TileBrushCollection();
        }
示例#3
0
        public TileBrushDialog(Map map, TileBrushCollection tileBrushCollection)
        {
            InitializeComponent();

            m_map = map;
            m_tileBrushCollection = tileBrushCollection;
            m_newTileBrush = null;
            m_selectedTileBrush = null;
        }
示例#4
0
        public EditTileBrushesCommand(
            Map map,
            TileBrushCollection currentTileBrushCollection,
            TileBrushCollection newTileBrushCollection)
        {
            m_map = map;
            m_currentTileBrushCollection = currentTileBrushCollection;
            m_oldTileBrushCollection = new TileBrushCollection(currentTileBrushCollection);
            m_newTileBrushCollection = new TileBrushCollection(newTileBrushCollection);

            m_description = "Manage tile brushes";
        }
示例#5
0
        public EditTileBrushesCommand(
            Map map,
            TileBrushCollection currentTileBrushCollection,
            TileBrush newTileBrush)
        {
            m_map = map;
            m_currentTileBrushCollection = currentTileBrushCollection;
            m_oldTileBrushCollection = new TileBrushCollection(currentTileBrushCollection);
            m_newTileBrushCollection = new TileBrushCollection(currentTileBrushCollection);
            m_newTileBrushCollection.TileBrushes.Add(newTileBrush);

            m_description = "Make new tile brush";
        }
示例#6
0
 internal TileBrushCollection(TileBrushCollection tileBrushCollection)
 {
     m_tileBrushes = new List<TileBrush>();
     foreach (TileBrush tileBrush in tileBrushCollection.TileBrushes)
         m_tileBrushes.Add(new TileBrush(tileBrush));
 }
示例#7
0
        private void OnDialogApply(object sender, EventArgs eventArgs)
        {
            Command command = null;
            if (m_newTileBrush != null)
            {
                command = new EditTileBrushesCommand(m_map, m_tileBrushCollection, m_newTileBrush);
            }
            else
            {
                TileBrushCollection newTileBrushCollection = new TileBrushCollection();

                foreach (ListViewItem listViewItem in m_listView.Items)
                {
                    // extract corresponding brushes and apply new ids
                    TileBrush newTileBrush = (TileBrush)listViewItem.Tag;

                    // add to collection
                    newTileBrushCollection.TileBrushes.Add(newTileBrush);
                }

                command = new EditTileBrushesCommand(m_map, m_tileBrushCollection, newTileBrushCollection);
            }

            CommandHistory.Instance.Do(command);

            MarkAsApplied();
        }