Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="contrib"></param>
 /// <param name="site"></param>
 /// <param name="remover"></param>
 public ControllerImpl(DummyCarContribution contrib, IControllerSite site, bool remover)
     : base(site)
 {
     this.remove       = remover;
     this.contribution = contrib;
     this.color        = contrib.currentColor;
 }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="target"></param>
 /// <param name="contrib"></param>
 /// <param name="color"></param>
 /// <param name="index"></param>
 public DummyCar(TrafficVoxel target, DummyCarContribution contrib, int color, int index)
 {
     this.index       = (byte)index;
     this.contrib     = contrib;
     this.color       = color;
     target.accessory = this;
 }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void OnColorChanged(object sender, System.EventArgs e)
        {
            DummyCarContribution builder = (DummyCarContribution)typeBox.SelectedItem;

            if (builder != null)
            {
                builder.currentColor = this.CurrentColor;
                UpdatePreview(builder);
            }
        }
Esempio n. 4
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);
            }
        }
Esempio n. 5
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);
        }