|
11 | 11 |
|
12 | 12 | namespace Moryx.Factory |
13 | 13 | { |
14 | | - /// <summary> |
15 | | - /// Class for MachineLocation in the factory |
16 | | - /// </summary> |
17 | | - public class MachineLocation : PublicResource, IMachineLocation |
18 | | - { |
19 | | - public IPublicResource Machine => Children.OfType<ICell>().FirstOrDefault(); |
20 | | - |
21 | | - [DataMember, EntrySerialize] |
22 | | - public string SpecificIcon { get; set; } |
23 | | - |
24 | | - [DataMember, EntrySerialize] |
25 | | - public string Image { get; set; } |
26 | | - |
27 | | - /// <summary> |
28 | | - /// X position of the location |
29 | | - /// </summary> |
30 | | - [DataMember, EntrySerialize, DefaultValue(10)] |
31 | | - public double PositionX { get; set; } |
32 | | - |
33 | 14 | /// <summary> |
34 | | - /// Y position of the location |
| 15 | + /// Class for MachineLocation in the factory |
35 | 16 | /// </summary> |
36 | | - [DataMember, EntrySerialize, DefaultValue(10)] |
37 | | - public double PositionY { get; set; } |
38 | | - |
39 | | - public Position Position |
| 17 | + public class MachineLocation : PublicResource, IMachineLocation |
40 | 18 | { |
41 | | - get => new() { PositionX = PositionX, PositionY = PositionY }; |
42 | | - set |
43 | | - { |
44 | | - PositionX = value.PositionX; |
45 | | - PositionY = value.PositionY; |
46 | | - } |
| 19 | + public IPublicResource Machine => Children.OfType<ICell>().FirstOrDefault(); |
| 20 | + |
| 21 | + [DataMember, EntrySerialize] |
| 22 | + public string SpecificIcon { get; set; } |
| 23 | + |
| 24 | + [DataMember, EntrySerialize] |
| 25 | + public string Image { get; set; } |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// X position of the location |
| 29 | + /// </summary> |
| 30 | + [DataMember, EntrySerialize, DefaultValue(0.5)] |
| 31 | + public double PositionX { get; set; } |
| 32 | + |
| 33 | + /// <summary> |
| 34 | + /// Y position of the location |
| 35 | + /// </summary> |
| 36 | + [DataMember, EntrySerialize, DefaultValue(0.5)] |
| 37 | + public double PositionY { get; set; } |
| 38 | + |
| 39 | + public Position Position |
| 40 | + { |
| 41 | + get => new() { PositionX = PositionX, PositionY = PositionY }; |
| 42 | + set |
| 43 | + { |
| 44 | + PositionX = value.PositionX; |
| 45 | + PositionY = value.PositionY; |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + [ResourceReference(ResourceRelationType.TransportRoute, ResourceReferenceRole.Source)] |
| 50 | + public IReferences<ITransportPath> Origins { get; set; } |
| 51 | + |
| 52 | + [ResourceReference(ResourceRelationType.TransportRoute, ResourceReferenceRole.Target)] |
| 53 | + public IReferences<ITransportPath> Destinations { get; set; } |
| 54 | + |
| 55 | + IEnumerable<ITransportPath> ILocation.Origins => Origins; |
| 56 | + IEnumerable<ITransportPath> ILocation.Destinations => Destinations; |
47 | 57 | } |
48 | | - |
49 | | - [ResourceReference(ResourceRelationType.TransportRoute, ResourceReferenceRole.Source)] |
50 | | - public IReferences<ITransportPath> Origins { get; set; } |
51 | | - |
52 | | - [ResourceReference(ResourceRelationType.TransportRoute, ResourceReferenceRole.Target)] |
53 | | - public IReferences<ITransportPath> Destinations { get; set; } |
54 | | - |
55 | | - IEnumerable<ITransportPath> ILocation.Origins => Origins; |
56 | | - IEnumerable<ITransportPath> ILocation.Destinations => Destinations; |
57 | | - } |
58 | 58 | } |
0 commit comments