internal TileBrushCollection(TileBrushCollection tileBrushCollection) { m_tileBrushes = new List <TileBrush>(); foreach (TileBrush tileBrush in tileBrushCollection.TileBrushes) { m_tileBrushes.Add(new TileBrush(tileBrush)); } }
public MainForm(string[] arguments) { InitializeComponent(); m_arguments = arguments; m_commandHistory = CommandHistory.Instance; m_tileBrushCollection = new TileBrushCollection(); }
public TileBrushDialog(Map map, TileBrushCollection tileBrushCollection) { InitializeComponent(); m_map = map; m_tileBrushCollection = tileBrushCollection; m_newTileBrush = null; m_selectedTileBrush = null; }
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"; }
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"; }
internal TileBrushCollection(TileBrushCollection tileBrushCollection) { m_tileBrushes = new List<TileBrush>(); foreach (TileBrush tileBrush in tileBrushCollection.TileBrushes) m_tileBrushes.Add(new TileBrush(tileBrush)); }
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(); }