summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/database/Database.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/fourisland/fourpuzzle/database/Database.java')
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/database/Database.java121
1 files changed, 121 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/database/Database.java b/src/com/fourisland/fourpuzzle/database/Database.java new file mode 100755 index 0000000..6d61f37 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/Database.java
@@ -0,0 +1,121 @@
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package com.fourisland.fourpuzzle.database;
7
8import com.fourisland.fourpuzzle.transition.Transition;
9
10/**
11 *
12 * @author hatkirby
13 */
14public class Database {
15
16 public static String getVocab(Vocabulary key)
17 {
18 return key.getValue();
19 }
20
21 /**
22 * Sets a Vocabulary definition
23 *
24 * FourPuzzle uses pre-defined Vocabulary strings in many places such as
25 * for the Title of the game, menu options and more. There are default
26 * values for all of these definitions, but you can change them if you wish,
27 * using this function.
28 *
29 * @param key The Vocabulary to set
30 * @param value The value to set the Vocabulary to
31 */
32 public static void setVocab(Vocabulary key, String value)
33 {
34 key.setValue(value);
35 }
36
37 /**
38 * Adds a Hero to the party
39 *
40 * When making a game, you need characters, at least one playable character.
41 * You have to create your characters and use this function to add them to
42 * the central list of playable characters, or your game will not work.
43 * There are no default characters, so this is a must-do.
44 *
45 * @param hero The Hero to add
46 */
47 public static void addHero(GameCharacter hero)
48 {
49 GameCharacters.getDefaultParty().add(hero);
50 }
51
52 public static GameCharacters createParty()
53 {
54 return GameCharacters.createParty();
55 }
56
57 public static String getMusic(Music key)
58 {
59 return key.getValue();
60 }
61
62 /**
63 * Change a default Music value
64 *
65 * In certain places of your game, such as the Title Screen and Game Over
66 * screen, background music plays. You can tell FourPuzzle what Music to
67 * play during these instances with this function. There are default values
68 * for all instances, though.
69 *
70 * @param key The Music instance you wish to change
71 * @param value The name of the Music file you wish to change it to
72 */
73 public static void setMusic(Music key, String value)
74 {
75 key.setValue(value);
76 }
77
78 public static Transition getTransition(Transitions key)
79 {
80 return key.getValue().copy();
81 }
82
83 /**
84 * Set a default Transition
85 *
86 * In certain places, a Transition may be displayed that you did not
87 * directly incur. These are default transitions, but they can be changed
88 * if you wish by using this function.
89 *
90 * Warning, all Transition instances have a required type of transition,
91 * whether it be In or Out. If you provide the wrong type of Transition for
92 * a certain instance, your game will not run.
93 *
94 * @param key The transition to change
95 * @param value The transition to change it to
96 */
97 public static void setTransition(Transitions key, Transition value)
98 {
99 key.setValue(value);
100 }
101
102 public static String getSound(Sound key)
103 {
104 return key.getValue();
105 }
106
107 /**
108 * Change a default sound effect
109 *
110 * Sound Effects are used in many places of the game. The default sound
111 * effects for certain situations can be changed using this function.
112 *
113 * @param key The Sound instance to change
114 * @param value The name of the Sound file to change it to
115 */
116 public static void setSound(Sound key, String value)
117 {
118 key.setValue(value);
119 }
120
121}