> For the complete documentation index, see [llms.txt](https://luffyyy.gitbook.io/beardlib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luffyyy.gitbook.io/beardlib/modules/classesmodule.md).

# Classes

Updated for version 3.37.

## Module Definition

The module inherits [ModuleBase](https://luffyyy.gitbook.io/beardlib/modules/modulebase). All parameters and functions of this class are inherited by the module.

### Module name

The name of the module you use as the meta of the module definition is 'Classes' or 'ClassesModule' if `_force_search` is set to true in the module definition.

### XML Structure

```markup
<Classes directory>
    <class file/>
    <classes>
    </classes>
</Classes>
```

#### `<Classes directory>`

| Parameter | Type   | Description                                                                                          |
| --------- | ------ | ---------------------------------------------------------------------------------------------------- |
| directory | String | directory/path relative to the mods directory which contains all the classes being used. \[OPTIONAL] |

#### `<class file/>`

| Parameter | Type   | Description                                                                                                         |
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| file      | String | File name of the class relative to the Mod directory and the directory defined in the main node if it was specified |

#### `<classes directory>`

\*Allows you to define classes in a more organized way. `directory` will join to the head `directory`

### Example

This example is what you would put inside your main node within your [mod config](https://github.com/GreatBigBushyBeard/PAYDAY-2-BeardLib/wiki/Module-Config)

```markup
<Classes directory="Classes">
    <class file="my_class.lua"/>
</Classes>
```

For this example your class will be in: `mods/MyMod/Classes/my_class.lua`. If you are using this module in a BLT mod.

#### `<classes>` example

```markup
<Classes directory="Classes">
    <classes directory="SubClasses">
        <class file="my_class.lua"/>
    </classes>
</Classes>
```

Now it will be in: `mods/MyMod/Classes/SubClasses/my_class.lua`.

### Functions

| Function                             | Description                                                                                                                                                                                                                                             |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Load(Table config, String prev\_div) | This is called normally by the module's init function, this is what loads all the classes. `config` is the current looping classes table (or self.\_config if not present) and `prev_dir` is the previous directory so it will join the directory to it |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://luffyyy.gitbook.io/beardlib/modules/classesmodule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
