[IDEA] Missing "window" wrapper within rooms.
Goal Description
foreach (Window window in room.Windows) window.Break();
foreach (Door door in room.Doors) door.Break();
Notes
No response
Okay there's solution for breaking Doors with TryBreak on BreakableDoor:
foreach (Door door in room.Doors)
{
door.IsOpened = true;
if (door is BreakableDoor breakable && !breakable.IsBroken)
breakable.TryBreak();
}
It wouldn't really make sense to add a Break method to the Door base class since not all doors are breakable, that's why you need to do a type check
First of all, thanks for the response.
Second, My post regards windows -> more specifically the "breakable" windows to work like the breakable doors.
Third it would be QoL if the API could check if the door or window is breakable and send warning to console that the door nor window is breakable when trying to destroy it. So we could use Door.TryDestroy() instead of checking if it's breakable first of all at end-user cases. API could do the check and return e.g. BOOL value, 0 failure and 1 success to provide more info.
Regards
Thank you for your suggestion! We've logged this issue in our internal git system for further review and tracking. Please note that this doesn't guarantee acceptance or implementation at this stage. If we need any additional information or clarification, we'll be sure to reach out to you.
We've reopened this suggestion to prevent confusion and duplicate posts. As stated before, the issue has been added to our internal tracker, but that does not guarantee acceptance nor implementation.