public override void AddPart(PartToolItemBase part2D, PartDesignBase part3D) { if (part3D != null) { AddToTab(part3D); } }
public ImpulseEngineToolItem(EditorOptions options, ImpulseEngineType engineType) : base(options) { _engineType = engineType; TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(Name, Description, options, this); }
public ConverterRadiationToEnergyToolItem(EditorOptions options, SolarPanelShape shape) : base(options) { this.Shape = shape; this.TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(this.Name, this.Description, options, this); }
public override void RemovePart(PartToolItemBase part2D, PartDesignBase part3D) { if (part3D != null) { RemoveFromTab(part3D); this.PreviousRemoved.Add(Tuple.Create(part3D.Token, DateTime.UtcNow)); } }
public SensorNetForceToolItem(EditorOptions options) : base(options) { this.TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(this.Name, this.Description, options, this); }
public CameraColorRGBToolItem(EditorOptions options) : base(options) { this.TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(this.Name, this.Description, options, this); }
public ConverterEnergyToFuelToolItem(EditorOptions options) : base(options) { this.TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(this.Name, this.Description, options, this); }
public BrainNEATToolItem(EditorOptions options) : base(options) { TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(Name, Description, options, this); }
public DirectionControllerSphereToolItem(EditorOptions options) : base(options) { this.TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(this.Name, this.Description, options, this); }
private DesignPart CreateDesignPart(ShipPartDNA dna) { #region Find ToolItem // Find the corresponding tool item List <PartToolItemBase> toolItems = _partToolItems.Where(o => o.PartType == dna.PartType).ToList(); if (toolItems.Count == 0) { throw new ApplicationException("Couldn't find the tool item for \"" + dna.PartType + "\""); } // Narrow down to one PartToolItemBase toolItem = null; if (toolItems.Count == 1) // if there's more than one, then it needs to be further filtered { toolItem = toolItems[0]; } else if (dna.PartType == ConverterRadiationToEnergy.PARTTYPE) { #region ConverterRadiationToEnergy ConverterRadiationToEnergyDNA dnaCast = (ConverterRadiationToEnergyDNA)dna; List <PartToolItemBase> additionalFilter = toolItems.Where(o => ((ConverterRadiationToEnergyToolItem)o).Shape == dnaCast.Shape).ToList(); if (additionalFilter.Count == 1) { toolItem = additionalFilter[0]; } #endregion } else if (dna.PartType == Thruster.PARTTYPE) { #region Thruster ThrusterDNA dnaCast = (ThrusterDNA)dna; if (dnaCast.ThrusterType == ThrusterType.Custom) { // Make a new one with the dna's directions toolItem = new ThrusterToolItem(editor1.Options, dnaCast.ThrusterDirections, "Custom"); } else { List <PartToolItemBase> additionalFilter = toolItems.Where(o => ((ThrusterToolItem)o).ThrusterType == dnaCast.ThrusterType).ToList(); if (additionalFilter.Count == 1) { toolItem = additionalFilter[0]; } } #endregion } else { throw new ApplicationException("Should have only found one tool item for this part type: " + dna.PartType); } if (toolItem == null) { throw new ApplicationException("Couldn't find the tool item for this part type: " + dna.PartType); } #endregion DesignPart retVal = new DesignPart(editor1.Options); retVal.Part2D = toolItem; retVal.Part3D = toolItem.GetNewDesignPart(); retVal.Part3D.SetDNA(dna); ModelVisual3D visual = new ModelVisual3D(); visual.Content = retVal.Part3D.Model; retVal.Model = visual; return(retVal); }
public TabControlParts_DragItem(PartDesignBase part3D, PartToolItemBase part2D = null, Action <TabControlParts_DragItem> dropped = null) { this.Part2D = part2D; this.Part3D = part3D; _dropped = dropped; }
/// <summary> /// This would get called if the user deleted a part, then later hit undo. That part needs to be removed from the tab control again /// </summary> public virtual void RemovePart(PartToolItemBase part2D, PartDesignBase part3D) { }
public TabControlParts_DragItem(PartDesignBase part3D, PartToolItemBase part2D = null, Action<TabControlParts_DragItem> dropped = null) { this.Part2D = part2D; this.Part3D = part3D; _dropped = dropped; }
public SensorArcbotWeaponToolItem(EditorOptions options) : base(options) { TabName = PartToolItemBase.TAB_SHIPPART; _visual2D = PartToolItemBase.GetVisual2D(Name, Description, options, this); }