Пример #1
0
        /// <summary>
        /// Called when a selection of the structure has changed.
        /// </summary>
        protected virtual void onTypeChanged(object sender, System.EventArgs e)
        {
            RoadAccessoryContribution builder = (RoadAccessoryContribution)typeBox.SelectedItem;

            if (builder != null)
            {
                using (PreviewDrawer drawer = builder.createPreview(preview.Size))
                {
                    if (previewBitmap != null)
                    {
                        previewBitmap.Dispose();
                    }
                    preview.Image = previewBitmap = drawer.createBitmap();
                }
                if (isPlacing)
                {
                    currentController = builder.createBuilder(this.siteImpl);
                }
                else
                {
                    currentController = builder.createRemover(this.siteImpl);
                }
            }
        }
Пример #2
0
 public ControllerImpl(RoadAccessoryContribution _contrib, IControllerSite _site, bool _remover) : base(_site)
 {
     this.contribution = _contrib;
     this.remove       = _remover;
 }
Пример #3
0
 public RoadAccessory(TrafficVoxel target, RoadAccessoryContribution _contrib, int _index)
 {
     this.index       = (byte)_index;
     this.contrib     = _contrib;
     target.accessory = this;
 }