# EventStorage

h{pt A class that is designed to manage and store events within the game.}c!pp

### class `EventStorage(name: str, location: str, *options: Option, fallback: Event = None, fallback_text: str = "There is nothing to do here")`

<div id="bkmrk-a-class-for-conditio">The `EventStorage` class is designed to manage and store events within the game. It provides methods to handle event data, update event states, and manage event conditions.</div><div id="bkmrk-the-storage-is-able-">The storage is able to select a single or a set of events based on their conditions and if they are fulfilled.</div><div id="bkmrk-this-storage-type-st">This Storage type stores the Event based on their select_type.</div><div id="bkmrk-"></div>#### Parameters:

<details id="bkmrk-blocking%3A-bool-%28defa"><summary>name: str</summary>

- The name of the storage.
- Used to reidentify the Storage

</details><details id="bkmrk-location%3A-str-the-lo"><summary>location: str</summary>

- The location the Storage should be part of.
- The location is either one of the games map locations or "misc"
- Possible values: "**bath**", "**beach**", "**cafeteria**", "**courtyard**", "**gym**", "**kiosk**", "**labs**", "**office\_building**", "**school\_building**", "**school\_dormitory**", "**sports\_field**", "**staff\_lodges**", "**swimming\_pool**", "**misc**"

</details><details id="bkmrk-%2Aoptions%3A-option-a-s"><summary>\*options: Option</summary>

- A set of options to configure the Storage
- A List of Options can be found here:

</details><details id="bkmrk-fallback%3A-event-%28def"><summary>fallback: Event (default: None)</summary>

- A fallback Event that is called instead, in case none of the Events stored are available
- If fallback is None, a default fallback event is called using the locations background image and the provided fallback text

</details><details id="bkmrk-fallback_text%3A-str-%28"><summary>fallback\_text: str (default: "There is nothing to do here.")</summary>

- The text that is displayed in case the Storage calls the default fallback event

</details>#### Methods:

<details id="bkmrk-is_fulfilled%28%2A%2Akwarg"><summary>is\_fulfilled(\*\*kwargs) -&gt; bool</summary>

Returns whether the stats of the character fulfill the condition

**Parameters:**

1. **\*\*kwargs**
    - Additional arguments
    - Method possibly checks for key '**char\_obj**' in **kwargs** looking for a Character Object

**Returns:**

1. **bool**  
    
    - Whether the condition is fulfilled or not

</details><details id="bkmrk-to_list_text%28%2A%2Akwarg"><summary>to\_list\_text(\*\*kwargs) -&gt; Tuple\[str, str\] | Tuple\[str, str, str\] | List\[Tuple\[str, str\] | Tuple\[str, str, str\]\]</summary>

<div><div>Returns the description text for the condition that is displayed in the display list.</div><div>If multiple stats are checked, the condition is displayed as a list.</div></div><div>  
</div><div>**Parameters:**</div><div>1. **\*\*kwargs**  
    
    - Additional arguments
    - Method possibly checks for key '**char\_obj**' in **kwargs** looking for a Character Object

</div>**Returns:**

1. **Tuple\[str, str\] | Tuple\[str, str, str\] | List\[Tuple\[str, str\] | Tuple\[str, str, str\]\]**
    - <div><div>The condition text for the display list.</div></div>
    - The first element is the icon, the second element is the value and the third element is the title.
    - <div><div>The title is optional.</div></div>
    - <div><div>Multiple conditions can be returned as a list.</div></div>

</details><details id="bkmrk-to_desc_text%28%2A%2Akwarg"><summary>to\_desc\_text(\*\*kwargs) -&gt; str | List\[str\]</summary>

<div><div><div>Returns the description text for the condition that is displayed in the description.</div><div>If multiple stats are checked, the condition is displayed as a list.</div></div></div><div>  
</div><div>**Parameters:**</div><div>1. **\*\*kwargs**  
    
    - Additional arguments
    - Method possibly checks for key '**char\_obj**' in **kwargs** looking for a Character Object

</div>**Returns:**

1. <div><div>**str | List\[str\]**</div></div>
    - <div><div>The condition text for the description.</div></div>
    - <div><div>Multiple conditions can be returned as a list.</div></div>

</details><details id="bkmrk-get_name%28%29--%3E-str-re"><summary>get\_name() -&gt; str</summary>

<div><div>Returns the name of the condition.</div><div>If multiple stats are checked, the condition is displayed as a comma separated list.</div></div><div>  
</div><div>**Returns:**</div><div>1. **str**
    - A List of checked Stats
    - Multiple stats are seperated by commas

</div></details><details id="bkmrk-get_diff%28char_obj%3A-s"><summary>get\_diff(char\_obj: Char) -&gt; num</summary>

<div><div>Returns the difference between the condition and the given character.  
If the condition difference is lower than -20, the difference is multiplied by 10.  
If the condition difference is lower than -10, the difference is multiplied by 5.  
If the condition difference is lower than -5, the difference is multiplied by 2.  
Otherwise the difference is returned as is.</div><div>This method is used to calculate the probability of the PTA approving.</div></div><div>  
</div><div>**Parameters:**</div><div>1. **char\_obj: Char**
    - The character to compare the condition to.

</div>**Returns:**

<div>1. **num**
    - The difference between the condition and the given character

</div></details>#### Examples:

```javascript
StatCondition("school", inhibition = 90)
```

```javascript
StatCondition(True, corruption = "20-30")
```

```javascript
StatCondition(happiness = "1,2,5,6")
```

```javascript
StatCondition(education = "10+", charm = "90-")
```

```javascript
StatCondition(reputation = "1,10-20,50+")
```