LaraMo / Risk-Swift-Sloths

COMP 345 project taken in Fall 2023 - creating the RISK game with C++
Apache License 2.0
0 stars 2 forks source link

Feature observer #35

Closed LaraMo closed 11 months ago

LaraMo commented 11 months ago

Note, the grand schema of the observer pattern has been completed. All left to do is to implement it once all the needed classes are merged.

// TODO: when merged // CommandProcessor::saveCommand() // Command::saveEffect() // Order::execute() --> DONE, BUT THE EFFECT ISNT READY, SO NEED TO ADD IT WHEN WE MERGE // OrderList::addOrder() // GameEngine::transition()

//todo: extend the following classes when merged: // Order - DONE // OrderList // GameEngine // Command // CommandProcessor

EyalAzimov commented 11 months ago

you wrote Order-DONE, does that mean you merged with orders-excution branch?

LaraMo commented 11 months ago

@EyalAzimov not quite, its means that when an order was created, the observer pattern was hooked up properly to observe such event.

image

once you merge, it will need to call notify(this) in the proper method. See comment: // Order::execute() --> DONE, BUT THE EFFECT ISNT READY, SO NEED TO ADD IT WHEN WE MERGE