Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using HEAL.Attic;
|
---|
5 | using HeuristicLab.Common;
|
---|
6 | using HeuristicLab.Core;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.Problems.Modifiers {
|
---|
9 | [Item("ProjectResourcesValue", "Represents a project and selected project resources.")]
|
---|
10 | [StorableType("897D2065-5C7D-448B-B9DB-4D612BF1844E")]
|
---|
11 | public class ProjectResourcesValue : Item {
|
---|
12 | [Storable]
|
---|
13 | private Guid projectId;
|
---|
14 | public Guid ProjectId {
|
---|
15 | get => projectId;
|
---|
16 | set {
|
---|
17 | if (projectId == value) return;
|
---|
18 | projectId = value;
|
---|
19 | OnToStringChanged();
|
---|
20 | }
|
---|
21 | }
|
---|
22 |
|
---|
23 | [Storable]
|
---|
24 | private List<Guid> resourceIds;
|
---|
25 | public List<Guid> ResourceIds {
|
---|
26 | get => resourceIds;
|
---|
27 | set {
|
---|
28 | if (resourceIds == value) return;
|
---|
29 | resourceIds = value;
|
---|
30 | OnToStringChanged();
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | [StorableConstructor]
|
---|
35 | protected ProjectResourcesValue(StorableConstructorFlag _) : base(_) { }
|
---|
36 | protected ProjectResourcesValue(ProjectResourcesValue original, Cloner cloner) : base(original, cloner) {
|
---|
37 | ProjectId = original.ProjectId;
|
---|
38 | ResourceIds = original.ResourceIds.Select(x => x).ToList();
|
---|
39 | }
|
---|
40 | public ProjectResourcesValue() {
|
---|
41 | ProjectId = Guid.Empty;
|
---|
42 | ResourceIds = new List<Guid>();
|
---|
43 | }
|
---|
44 |
|
---|
45 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
46 | return new ProjectResourcesValue(this, cloner);
|
---|
47 | }
|
---|
48 |
|
---|
49 | public override string ToString() {
|
---|
50 | return $"ProjectId: {ProjectId}, NrOfResources: {ResourceIds.Count}";
|
---|
51 | }
|
---|
52 | }
|
---|
53 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.