public ProductionInformation(ManufactureType project, Action<ManufactureProject> action) { production = new ManufactureProject { ManufactureType = project, UnitsToProduce = 1 }; this.action = action; var metadata = project.Metadata(); AddControl(new Border(20, 0, 320, 160, ColorScheme.Blue, Backgrounds.Workshop, 1)); AddControl(new Label(30, Label.Center, metadata.Name, Font.Large, ColorScheme.Blue)); AddControl(new Label(50, 16, metadata.HoursToProduce.FormatNumber() + " Engineer hours to produce one unit", Font.Normal, ColorScheme.Blue)); AddControl(new Label(60, 16, "Cost per unit>$", Font.Normal, ColorScheme.Blue)); AddControl(new Label(60, 87, metadata.Cost.FormatNumber(), Font.Normal, ColorScheme.White)); AddControl(new Label(70, 16, "Work Space Required>", Font.Normal, ColorScheme.Blue)); AddControl(new Label(70, 112, metadata.SpaceRequired.FormatNumber(), Font.Normal, ColorScheme.White)); var specialMaterials = metadata.SpecialMaterials; if (specialMaterials.Any()) DisplaySpecialMaterials(specialMaterials); AddControl(new Button(155, 16, 135, 16, "CANCEL", ColorScheme.Blue, Font.Normal, EndModal)); if (production.CanProduce(GameState.SelectedBase) && metadata.SpaceRequired <= GameState.SelectedBase.WorkshopSpaceAvailable) AddControl(new Button(155, 168, 135, 16, "START PRODUCTION", ColorScheme.Blue, Font.Normal, OnStartProduction)); }
private void OnSelectProject(ManufactureType project) { new ProductionInformation(project, OnStartProduction).DoModal(this); }