Logo

Braindead.bzh

Game Dev Hobbyist

A blog about my game dev hobby and various stuff.

Menu
Logo

Braindead.bzh

Game Dev Hobbyist

A blog about my game dev hobby and various stuff.

Databases

Overview

CardDatabase class: res://addons/cardengine/database/database.gd (source)
DatabaseManager class: res://addons/cardengine/database/database_manager.gd (source)

CardEngine stores card's data inside databases. You can create one or more databases depending on your need. Usually one should be sufficient and easier to manage.

CardEngine database are file based and can be found inside the _private/databases folder in the format <database ID>.data. Such files should not be edited by hand.

Databases are identified by an unique ID which is defined during creation and cannot be changed. Databases also have a name for display purpose, also defined during creation, it can be changed.

Creation

To create a database press the "Create new database" button. Fill in the ID and the name. The ID cannot contain spaces, can only contain a-z A-Z 0-9 characters and cannot start with a number. The name can be any non-empty string of characters.

Deletion

To delete a database, select it in the list and press the "Delete database" button. You will have to validate the delete with the confirm dialog. Be careful, deleting a database is not reversible.

Changing ID and name

The ID cannot be changed.

The name can be changed by double-clicking the database in the list.

Editing the database

The dialog

At the top of the dialog box you find the filters which allow you to find the cards you are looking for. Filters are generated automatically to reflect the content of the database.

On the left you find the list of cards in the database. The cards are identified by their ID, the only mandatory data. If cards have a "name" text it is displayed along the ID between parenthesis. Card in the list can be selected by single click.

On the right you find the card details pane. When selecting a card, it displays the data attached to the card. No interaction on the data is possible here. Instead you find two buttons at the bottom to delete or edit a card.

At the bottom you find the "Done" button to close the dialog.

Creating a card

You don't create cards from this dialog, refer to the "Cards" chapter for more details.

Editing a card

To edit a card, select the card in the list on the left then press the "Edit" button a the bottom of the right pane. You will be transferred to the "Cards" page where the actual edit will take place, refer to the "Cards" chapter for more details.

Deleting a card

To delete a card, select the card in the list on the left then press the "Delete" button a the bottom of the right pane. A confirmation will be asked, be careful this is not a recoverable action.

Duplicating a card

To duplicate a card, select the card in the list on the left then press the "Duplicate" button at the bottom of the right pane. As there cannot be cards with the same ID, you will presented with a dialog to enter an ID for the duplicate. Once a proper ID entered you can press "Confirm" at the bottom of the dialog, you should see your duplicated card added to the list.