Пример #1
0
 public void Render(Listing listing)
 {
     if (_data != null && _buffer != null)
     {
         Graphics gfx = Graphics.FromImage(_buffer);
         int      i   = _data.IndexOf(listing);
         _core.ClearMemory();
         listing.Compile(_core);
         _coreView.RenderBasic(_core, listing.Color);
         gfx.DrawImage(_coreView.Image, i * (_coreView.Width + _coreMargin), 0);
     }
     Invalidate();
 }
Пример #2
0
        private void SetListing(Listing listing)
        {
            if (_listing != null)
            {
                _listing.Unload(SelectedCore);
            }

            _listing = listing;
            listingBox.SelectionBackColor = Color.FromArgb(34, 26, 55);
            listingBox.Lines = listing.Lines.ToArray();
            _listing.Parse(listingBox.Lines);
            _listing.Compile(SelectedCore);
            UpdateView(false);
        }
Пример #3
0
        private void OnListingChanged(Listing sender)
        {
            if (_started)
            {
                return;
            }

            int index = _deck.IndexOf(sender);

            foreach (Core core in _grid.ListOfEntries.Where(e => e.ListingID == index).Select(e => e.Core))
            {
                core.ClearMemory();
                sender.Compile(core);
                Draw(core);
            }
        }
Пример #4
0
        private void deckSlotPaste_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem slotEntry = sender as ToolStripMenuItem;
            Core    core    = gridContextMenu.Tag as Core;
            Listing listing = slotEntry.Tag as Listing;

            if (core == null || listing == null)
            {
                return;
            }

            int index = _deck.IndexOf(listing);

            Grid.Entry coreEntry = _grid.ListOfEntries.Where(entry => entry.Core == core).FirstOrDefault();
            coreEntry.ListingID = index;
            coreEntry.Color     = listing.Color;

            core.ClearMemory();
            listing.Compile(core);
            Draw(core);

            //update scenario
            _scenario = Scenario.Create(_grid, _ga.Energy, _deck, _scenario.MissionStatement, true);
        }
Пример #5
0
        private void OnListingChanged(Listing sender)
        {
            if(_started)
                return;

            int index = _deck.IndexOf(sender);
            foreach (Core core in _grid.ListOfEntries.Where(e => e.ListingID == index).Select(e => e.Core))
            {
                core.ClearMemory();
                sender.Compile(core);
                Draw(core);
            }
        }
Пример #6
0
        private void SetListing(Listing listing)
        {
            if(_listing != null)
                _listing.Unload(SelectedCore);

            _listing = listing;
            listingBox.SelectionBackColor = Color.FromArgb(34, 26, 55);
            listingBox.Lines = listing.Lines.ToArray();
            _listing.Parse(listingBox.Lines);
            _listing.Compile(SelectedCore);
            UpdateView(false);
        }
Пример #7
0
 private void ParseListing()
 {
     _listing.Unload(SelectedCore);
     _listing.Parse(listingBox.Lines);
     _listing.Compile(SelectedCore);
 }
Пример #8
0
 public void Render(Listing listing)
 {
     if (_data != null && _buffer != null)
     {
         Graphics gfx = Graphics.FromImage(_buffer);
         int i = _data.IndexOf(listing);
         _core.ClearMemory();
         listing.Compile(_core);
         _coreView.RenderBasic(_core, listing.Color);
         gfx.DrawImage(_coreView.Image, i * (_coreView.Width + _coreMargin), 0);
     }
     Invalidate();
 }