NTUT-FUCK-PTSD / Fuck-PTSD

This is a repo about rewriting the game `crypt of the necrodancer` in OOP Lab
MIT License
2 stars 2 forks source link

Add WallRemove and FloorUpdate events and handle them in Map class #147

Closed HeavenManySugar closed 3 months ago

HeavenManySugar commented 3 months ago

This pull request adds two new event types, WallRemove and FloorUpdate, to the EventType enum in EventType.h. It also introduces two new event classes, WallRemoveEventArgs and FloorUpdateEventArgs, in EventArgs.h. In Map::InitEvent() in Event.cpp, listeners are appended to the m_Event object to handle the WallRemove and FloorUpdate events. The WallRemove listener calls the RemoveWall() method with the map index provided in the WallRemoveEventArgs, allowing for the removal of walls in the game when the corresponding event is triggered. The FloorUpdate listener dispatches the FloorUpdate event with the corresponding arguments, allowing for the updating of the floor in the game when the tempo changes, and also providing information about the tempo index and whether the floor should be colored.