File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
MethodSystem/Methods/DoorMethods Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 22using SER . ArgumentSystem . Arguments ;
33using SER . ArgumentSystem . BaseArguments ;
44using SER . MethodSystem . BaseMethods ;
5+ using SER . MethodSystem . MethodDescriptors ;
56
67namespace 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}
You can’t perform that action at this time.
0 commit comments