vault backup: 2025-09-20 12:47:05
This commit is contained in:
+27
-7
@@ -10,19 +10,33 @@ tags:
|
||||
# Assembly Objects
|
||||
|
||||
```cs
|
||||
public class GangableReceptacle : IGangableDevice
|
||||
...
|
||||
public class GangableReceptacle : IGangableDevice, IUtilizationEquipment
|
||||
{
|
||||
public int Gangs { get; }
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
public class GangableSwitch : IGangableDevice
|
||||
...
|
||||
|
||||
public class OutletBox
|
||||
public class DeviceBox : IOutletBox
|
||||
{
|
||||
public List<IUtilizationEquipment> Contents;
|
||||
private List<IGangableDevice> _contents;
|
||||
|
||||
public void Add(IUtilizationEquipment)
|
||||
public void Add(IGangableDevice device)
|
||||
{
|
||||
// Add to contents or throw if incompatible
|
||||
_contents.Add(device);
|
||||
}
|
||||
|
||||
public int GetGangs()
|
||||
{
|
||||
int gangs = 0;
|
||||
foreach (device in _contents)
|
||||
{
|
||||
gangs += device.Gangs
|
||||
}
|
||||
return gangs
|
||||
}
|
||||
|
||||
public List<Item> Resolve()
|
||||
@@ -43,9 +57,15 @@ public class OutletBox
|
||||
- type: transfer-switch
|
||||
parents: 2
|
||||
children: 1
|
||||
primary-rating: amperes
|
||||
|
||||
- type: transformer
|
||||
parents: 1
|
||||
children: 1
|
||||
children: 1..
|
||||
primary-rating: volt-amperes
|
||||
|
||||
- type: generator
|
||||
parents: 0
|
||||
children: 1..
|
||||
primary-rating: watts
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user