public class QueryFactory
extends java.lang.Object
Constructor and Description |
---|
QueryFactory(TARDIS plugin) |
Modifier and Type | Method and Description |
---|---|
void |
addToVoid(int id)
Add a TARDIS id to the thevoid table.
|
void |
alterCondenserBlockCount(int amount,
java.util.HashMap<java.lang.String,java.lang.Object> where)
Removes condenser block counts from an SQLite database table.
|
void |
alterEnergyLevel(java.lang.String table,
int amount,
java.util.HashMap<java.lang.String,java.lang.Object> where,
org.bukkit.entity.Player p)
Adds or removes Artron Energy from an SQLite database table.
|
boolean |
claimTARDIS(org.bukkit.entity.Player player,
int id)
Claim an abandoned TARDIS.
|
void |
doDelete(java.lang.String table,
java.util.HashMap<java.lang.String,java.lang.Object> where)
Deletes rows from an SQLite database table.
|
void |
doInsert(java.lang.String table,
java.util.HashMap<java.lang.String,java.lang.Object> data)
Inserts data into an SQLite database table.
|
boolean |
doSyncDelete(java.lang.String table,
java.util.HashMap<java.lang.String,java.lang.Object> where)
Deletes rows from an SQLite database table.
|
int |
doSyncInsert(java.lang.String table,
java.util.HashMap<java.lang.String,java.lang.Object> data)
Inserts data into an SQLite database table.
|
void |
doSyncUpdate(java.lang.String table,
java.util.HashMap<java.lang.String,java.lang.Object> data,
java.util.HashMap<java.lang.String,java.lang.Object> where)
Updates data in an SQLite database table.
|
void |
doUpdate(java.lang.String table,
java.util.HashMap<java.lang.String,java.lang.Object> data,
java.util.HashMap<java.lang.String,java.lang.Object> where)
Updates data in an SQLite database table.
|
void |
insertControl(int id,
int type,
java.lang.String l,
int s)
Inserts or updates data in a database table.
|
void |
insertLocations(java.util.HashMap<java.lang.String,java.lang.Object> data,
java.lang.String biome,
int id)
Inserts data into an SQLite database table.
|
void |
insertSyncControl(int id,
int type,
java.lang.String l,
int s)
Inserts or updates data in a database table.
|
void |
saveBiome(int id,
java.lang.String biome)
Save the biome the Police Box lands in to the current table so that it can be restored after it leaves.
|
void |
updateCondensedBlockCount(int new_size,
int id,
java.lang.String block_data)
Updates the Artron condenser block count for a specific block.
|
void |
updateLocations(java.util.HashMap<java.lang.String,java.lang.Object> data,
java.lang.String biome,
int id)
Updates data in an SQLite database table.
|
public QueryFactory(TARDIS plugin)
public void doInsert(java.lang.String table, java.util.HashMap<java.lang.String,java.lang.Object> data)
table
- the database table name to insert the data into.data
- a HashMap<String, Object> of table fields and values to insert.public int doSyncInsert(java.lang.String table, java.util.HashMap<java.lang.String,java.lang.Object> data)
table
- the database table name to insert the data into.data
- a HashMap<String, Object> of table fields and values to insert.public void doUpdate(java.lang.String table, java.util.HashMap<java.lang.String,java.lang.Object> data, java.util.HashMap<java.lang.String,java.lang.Object> where)
table
- the database table name to update.data
- a HashMap<String, Object> of table fields and values update.where
- a HashMap<String, Object> of table fields and values to select the records to update.public void doSyncUpdate(java.lang.String table, java.util.HashMap<java.lang.String,java.lang.Object> data, java.util.HashMap<java.lang.String,java.lang.Object> where)
table
- the database table name to update.data
- a HashMap<String, Object> of table fields and values update.where
- a HashMap<String, Object> of table fields and values to select the records to update.public void doDelete(java.lang.String table, java.util.HashMap<java.lang.String,java.lang.Object> where)
table
- the database table name to insert the data into.where
- a HashMap<String, Object> of table fields and values to select the records to delete.public boolean doSyncDelete(java.lang.String table, java.util.HashMap<java.lang.String,java.lang.Object> where)
table
- the database table name to insert the data into.where
- a HashMap<String, Object> of table fields and values to select the records to delete.public void alterEnergyLevel(java.lang.String table, int amount, java.util.HashMap<java.lang.String,java.lang.Object> where, org.bukkit.entity.Player p)
table
- the database table name to insert the data into.amount
- the amount of energy to add or remove (use a negative value)where
- a HashMap<String, Object> of table fields and values to select the records to alter.p
- the player who receives the success message.public void alterCondenserBlockCount(int amount, java.util.HashMap<java.lang.String,java.lang.Object> where)
amount
- the amount of blocks to removewhere
- a HashMap<String, Object> of table fields and values to select the records to alter.public void insertControl(int id, int type, java.lang.String l, int s)
id
- the database table name to insert the data into.type
- the type of control to insert.l
- the string location of the controls
- what level the control is (0 primary, 1 secondary (BAKER), 2 tertiary (WOOD))public void insertSyncControl(int id, int type, java.lang.String l, int s)
id
- the database table name to insert the data into.type
- the type of control to insert.l
- the string location of the controls
- what level the control is (0 primary, 1 secondary (BAKER), 2 tertiary (WOOD))public void insertLocations(java.util.HashMap<java.lang.String,java.lang.Object> data, java.lang.String biome, int id)
data
- a HashMap<String, Object> of table fields and values to insert.biome
- the biome of the Police Box locationid
- the tardis_idpublic void updateLocations(java.util.HashMap<java.lang.String,java.lang.Object> data, java.lang.String biome, int id)
data
- a HashMap<String, Object> of table fields and values to update.biome
- the biome value to updateid
- the tardis_idpublic void updateCondensedBlockCount(int new_size, int id, java.lang.String block_data)
new_size
- the newly calculated total number of blocks condensedid
- the tardis_id of the record to updateblock_data
- the block_data of the record to updatepublic void saveBiome(int id, java.lang.String biome)
id
- the TARDIS to updatebiome
- the biome to savepublic void addToVoid(int id)
id
- the tardis_id to addpublic boolean claimTARDIS(org.bukkit.entity.Player player, int id)
player
- the claiming playerid
- the TARDIS id