Category : design-patterns

Working on a school project, but I’m completely stuck. I have to write a paint application, in which you can draw Rectangles & Ellipses, select them, group them, move and resize them. After that I have to start implementing several design patterns. I have to following problem. I have an abstract class Figure which inherits ..

Read more

How efficiently can I write setScore() without adding it to IObserver ? Is there any better to add such method ? or any better implementation than this ? PLEASE HELP. ObserverPattern.cpp:88:7: error: ‘class IObservable’ has no member named ‘setScore’ //interface class IObserver { public: virtual void update(int) = 0; }; //interface class IObservable { public: ..

Read more

So input data for my program comes from a json file and doesn’t change throughout execution. For now I load input data into number of different objects and object containers, which all reside in ‘Data’ object. Because all the ‘Data’ object does is holding data, every object is a struct with public members. I read ..

Read more

I am designing the Photoshop analog using ImGui. I update state of application every frame, even if there is no changes. But there are some computationally expensive operations and I want to update state of application only when something is changed. However when you have several control panels and trying to check their state you ..

Read more