57 lines
2.2 KiB
Markdown
57 lines
2.2 KiB
Markdown
# dbEffectsBaseHandler Documentation
|
|||
|
|
|
||
|
|
## Overview
|
||
|
|
This document describes the database relationships and interactions for the `dbEffectsBaseHandler` class. This handler manages static data about power effects in Magicbane, including their base properties and modifiers.
|
||
|
|
|
||
|
|
## Handler Class
|
||
|
|
**File:** `src/engine/db/handlers/dbEffectsBaseHandler.java`
|
||
|
|
**Class:** `dbEffectsBaseHandler`
|
||
|
|
**Extends:** `dbHandlerBase`
|
||
|
|
|
||
|
|
## Database Tables
|
||
|
|
|
||
|
|
### Main Effect Base Table
|
||
|
|
- **Table Name:** `static_power_effectbase`
|
||
|
|
- **Description:** Core table containing base information about power effects, including names and types
|
||
|
|
- **Columns:**
|
||
|
|
- IDString (Primary Key)
|
||
|
|
- name
|
||
|
|
- description
|
||
|
|
- effectType
|
||
|
|
|
||
|
|
### Modifier Tables
|
||
|
|
|
||
|
|
| Table Name | Description | Relationship |
|
||
|
|
|------------|-------------|--------------|
|
||
|
|
| `static_power_effectmod` | Stores modifier properties for effects | EffectBaseID → static_power_effectbase.IDString |
|
||
|
|
|
||
|
|
## Key Queries
|
||
|
|
|
||
|
|
### Get All Effects Base
|
||
|
|
```sql
|
||
|
|
SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC
|
||
|
|
```
|
||
|
|
**File:** `dbEffectsBaseHandler.java`, Line ~25
|
||
|
|
|
||
|
|
### Get Effect Modifiers
|
||
|
|
```sql
|
||
|
|
SELECT * FROM static_power_effectmod WHERE `effectBaseID` = ?
|
||
|
|
```
|
||
|
|
**File:** `dbEffectsBaseHandler.java`, Line ~40
|
||
|
|
|
||
|
|
## Relationships
|
||
|
|
|
||
|
|
1. **Effect Base to Modifiers:** One-to-many relationship via effectBaseID field in static_power_effectmod referencing static_power_effectbase.IDString
|
||
|
|
2. **Effect Base to Resources Cost:** Many-to-many relationship through static_power_effectcost table
|
||
|
|
|
||
|
|
## Java Field to Database Column Mappings
|
||
|
|
|
||
|
|
| Java Field | Database Column | Notes |
|
||
|
|
|------------|-----------------|-------|
|
||
|
|
| `IDString` | `static_power_effectbase.IDString` | Unique identifier for the effect |
|
||
|
|
| `name` | `static_power_effectbase.name` | Display name of the effect |
|
||
|
|
| `description` | `static_power_effectbase.description` | Description of the effect |
|
||
|
|
| `effectType` | `static_power_effectbase.effectType` | Type of effect |
|
||
|
|
| `modType` | `static_power_effectmod.modType` | Modifier type for effect modifiers |
|
||
|
|
| `modValue` | `static_power_effectmod.modValue` | Value of the modifier |
|
||
|
|
| `other fields...` | Various columns | Other properties related to effects and modifiers |
|