Skip to content

Commit de68eb1

Browse files
Update RepairDoorMethod.cs
1 parent 9bf18b3 commit de68eb1

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

MethodSystem/Methods/DoorMethods/RepairDoorMethod.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,26 @@
22
using SER.ArgumentSystem.Arguments;
33
using SER.ArgumentSystem.BaseArguments;
44
using SER.MethodSystem.BaseMethods;
5+
using SER.MethodSystem.MethodDescriptors;
56

67
namespace SER.MethodSystem.Methods.DoorMethods;
7-
public class RepairDoorMethod : SynchronousMethod
8+
9+
public class RepairDoorMethod : SynchronousMethod, IAdditionalDescription
810
{
9-
public override string Description => "Repairs specified doors if possible (for example, you can't repair Gate B, but you can repair normal HCZ doors)";
11+
public override string Description => "Repairs specified doors if possible";
12+
13+
public string AdditionalDescription =>
14+
"Remember, you can't repair things like gates, but you can repair normal doors like HCZ doors";
1015

1116
public override Argument[] ExpectedArguments =>
1217
[
13-
new DoorsArgument("doors")
14-
{
15-
Description="Doors to repair"
16-
}
18+
new DoorsArgument("doors to repair")
1719
];
1820

1921
public override void Execute()
2022
{
21-
Door[] doors = Args.GetDoors("doors");
22-
foreach(Door door in doors)
23-
{
24-
if(door is BreakableDoor brek)
25-
{
26-
brek.TryRepair();
27-
}
28-
}
23+
Args.GetDoors("doors to repair")
24+
.OfType<Door, BreakableDoor>()
25+
.ForEach(door => door.TryRepair());
2926
}
3027
}

0 commit comments

Comments
 (0)