diff --git a/README.md b/README.md index e58f3e02e2afd32885d8d0db18f15a3b7958d5bd..98b8b1eb2c719b0f7959fd8f2c95bd3ce43398f7 100644 --- a/README.md +++ b/README.md @@ -918,7 +918,8 @@ Reads all input from SDL, preprocesses it and stores it in the `Toolbox` event c **Usage** -Todo +- Construct object +- At the beginning of each frame, call `update` to update the `Toolbox` event chain **Constructors and Destructors** @@ -955,7 +956,22 @@ Represents a message to one of the components **Usage** -Todo +- Construct object using a message, e.g. `WAVEMESSAGE::RESET_DAMPING` or `PATTERNMESSAGE::PATTERN_SSH` (see `*MESSAGE` types in [enums](#enums-enumshpp)) +- Read messages using the pattern +```c++ +Message m = getSomeMessage(); +if(m.target == MESSAGETARGET::WAVE){ + WAVEMESSAGE message = std::get<WAVEMESSAGE>(m.message); + switch(message){ + case WAVEMESSAGE::RESET_WAVE: + //process RESET_WAVE here + case WAVEMESSAGE::RESET_DAMPING: + //process RESET_DAMPING here + default: + break; + } +} +``` **Constructors and Destructors** @@ -1084,6 +1100,7 @@ Todo - `PeventFactory()` - `PeventFactory(const int screen_w, const int screen_h, const int texture_w, const int texture_h, const int texoffset_left, const int texoffset_right, const int texoffset_bottom, const int texoffset_top)` - This constructor should be changed to take a `Toolbox` instead. + **Public Function Members** - `Pevent operator()(const SDL_Event&) const` @@ -1458,7 +1475,7 @@ Todo **Public Data Members** -Todo +N/A **Private Data Members** Only relevant members are listed @@ -1483,7 +1500,7 @@ Only relevant members are listed This class predates the Toolbox and is not yet well integrated into the flow. All member functions assume the object is fully initialized. ## Enums ([enums.hpp](include/enums.hpp)) -**`MSTATE`** (Mouse State): `IMMEDIATE` (Zeichnen), `PLACE`, `DELETE`, `MOVE`, `DRAW` (Zeichnen), `Erase` (Radieren) +**`MSTATE`** (Mouse State): `IMMEDIATE` (Spielen), `PLACE`, `DELETE`, `MOVE`, `DRAW` (Zeichnen), `Erase` (Radieren) **`SSTATE`** (Source State): `RUN`, `STOP` @@ -1491,17 +1508,17 @@ This class predates the Toolbox and is not yet well integrated into the flow. Al **`MESSAGETARGET`** (Possible targets for messages): `BLOCKCHAIN`, `DRAWER`, `GUI`, `WAVE`, `PATTERN` -**`BLOCKCHAINMESSAGE`** (Possible messages to the `SlimBlockchainHandler`): `CLEAR`, `PATTERN_SINGLESLIT`, `PATTERN_DOUBLESLIT`, `PATTER_LATTICE`, `PATTERN_WAVEGUIDE`, `PATTERN_SSH`, `PATTERN_FRESNEL` +**`BLOCKCHAINMESSAGE`** (Possible messages to `SlimBlockchainHandler`): `CLEAR`, `PATTERN_SINGLESLIT`, `PATTERN_DOUBLESLIT`, `PATTER_LATTICE`, `PATTERN_WAVEGUIDE`, `PATTERN_SSH`, `PATTERN_FRESNEL` -**`PATTERNMESSAGE`**: `PATTERN_SINGLESLIT`, `PATTERN_DOUBLESLIT`, `PATTER_LATTICE`, `PATTERN_WAVEGUIDE`, `PATTERN_SSH`, `PATTERN_FRESNEL` +**`PATTERNMESSAGE`** (Possible messages to `PatternHandler`): `PATTERN_SINGLESLIT`, `PATTERN_DOUBLESLIT`, `PATTER_LATTICE`, `PATTERN_WAVEGUIDE`, `PATTERN_SSH`, `PATTERN_FRESNEL` -**`DRAWERMESSAGE`**: `CLEAR` +**`DRAWERMESSAGE`** (Possible messages to `DrawingHandler`): `CLEAR` -**`GUIMESSAGE`**: n/a +**`GUIMESSAGE`** (Possible messages to `GuiHandler`): n/a -**`WAVEMESSAGE`**: `RESET_WAVE`, `RESET_DAMPING`, `DIMENSION_2D`, `DIMENSION_3D`, `DEBUG_ON`, `DEBUG_OFF` +**`WAVEMESSAGE`** (Possible messages to `WaveHandler`): `RESET_WAVE`, `RESET_DAMPING`, `DIMENSION_2D`, `DIMENSION_3D`, `DEBUG_ON`, `DEBUG_OFF` -**`PEVENTTYPE`**: `DOWN`, `UP`, `MOVE`, `OTHER` +**`PEVENTTYPE`** (Possible `Pevent` types): `DOWN`, `UP`, `MOVE`, `OTHER` ## ImGui Customization The ImGui library has been customized in the following way: