예제 #1
0
 public DummyCar(TrafficVoxel target, DummyCarContribution _contrib, int _color, int _index)
 {
     this.index       = (byte)_index;
     this.contrib     = _contrib;
     this.color       = _color;
     target.accessory = this;
 }
예제 #2
0
        protected virtual void onColorChanged(object sender, System.EventArgs e)
        {
            DummyCarContribution builder = (DummyCarContribution)typeBox.SelectedItem;

            if (builder != null)
            {
                builder.currentColor = this.currentColor;
                updatePreview(builder);
            }
        }
예제 #3
0
        private void onTypeChanged(object sender, System.EventArgs e)
        {
            DummyCarContribution builder = (DummyCarContribution)typeBox.SelectedItem;

            if (builder != null)
            {
                int colors = builder.colorVariations;
                if (this.colSelector.current > colors)
                {
                    this.colSelector.current = colors;
                }
                this.colSelector.count = colors;
                builder.currentColor   = colors;
                updatePreview(builder);
            }
        }
예제 #4
0
        /// <summary>
        /// Called when a selection of the structure has changed.
        /// </summary>
        protected virtual void updatePreview(DummyCarContribution builder)
        {
            //DummyCarContribution builder = (DummyCarContribution)typeBox.SelectedItem;
            using (PreviewDrawer drawer = new PreviewDrawer(preview.Size, new Size(10, 1), 0)) {
                drawer.draw(builder.getSprites(), 5, 0);

                if (previewBitmap != null)
                {
                    previewBitmap.Dispose();
                }
                preview.Image = previewBitmap = drawer.createBitmap();
            }
            if (isPlacing)
            {
                currentController = builder.createBuilder(this.siteImpl);
            }
            else
            {
                currentController = builder.createRemover(this.siteImpl);
            }
        }
예제 #5
0
 public ControllerImpl(DummyCarContribution _contrib, IControllerSite _site, bool _remover) : base(_site)
 {
     this.remove       = _remover;
     this.contribution = _contrib;
     this.color        = _contrib.currentColor;
 }