Exemplo n.º 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;
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 5
0
 public ControllerImpl(DummyCarContribution _contrib, IControllerSite _site, bool _remover) : base(_site)
 {
     this.remove       = _remover;
     this.contribution = _contrib;
     this.color        = _contrib.currentColor;
 }