# Model

For this example, I will create a health indicator. The model is responsible for creating and keeping the VM up to date. I don't create a new VM for each specific Widget, I create one VM for all Widgets. If the functionality in the future will not be enough, it is worth to finalize the VM. This approach gives minimal constraints and minimal effort when creating Widgets.

<figure><img src="/files/BeyfZfehj7soPT4BePqo" alt="" width="563"><figcaption><p>Project Structure</p></figcaption></figure>

Inside C++ I use subsystems, but they can't be created inside BP. So I use the constructor to create VMs.

<figure><img src="/files/tcr5kDPRRKbUvD46Oz6j" alt="" width="563"><figcaption><p>Construct VM</p></figcaption></figure>

Any changes to the underlying value are accompanied by an update to the value within the VM, which will start a chain of updates.

<figure><img src="/files/GBPRj9uC5p7bpAnij5gK" alt="" width="563"><figcaption><p>Set Health</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mvvm.labutin.gg/health-bar/model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
