net.sf.magicproject.deckbuilder
Class MdbLoader

java.lang.Object
  extended by net.sf.magicproject.deckbuilder.MdbLoader

public final class MdbLoader
extends java.lang.Object

Set of tools to manipulate the MDB format : load headers, finding cards,...

Since:
0.54
Author:
Fabrice Daugan

Field Summary
static java.lang.String artURL
          Indicates where to find the art from a URL
static java.lang.String author
          The current TBS comment
static java.lang.String backPicture
          Indicates the picture name of the back picture.
static java.lang.String[] coloredBigManas
          This is the defined small colorled mana file names without basename.
static java.lang.String coloredManaBigURL
          This is the web basename where big colorled mana pictures can be found.
static java.lang.String coloredManaSmlURL
          This is the web basename where small colorled mana pictures can be found.
static java.lang.String[] coloredSmlManas
          This is the defined small colorled mana file names without basename.
static java.lang.String[] coloredSmlManasHtml
          This the HTML representation of defined small colorled manas.
static java.lang.String colorlessBigURL
          This is the filename without basename corresponding to the big colorless picture.
static java.lang.String[] colorlessSmlManas
          This is the defined colorless mana file names without basename.
static java.lang.String[] colorlessSmlManasHtml
          This the HTML representation of defined small colorless manas.
static java.lang.String colorlessURL
          This is the web basename where colorless mana pictures can be found.
static java.lang.String damagePicture
          Indicates the picture name of the damage picture.
static java.lang.String disclaimer
          The current TBS disclaimer
static java.io.FileInputStream lastMdbStream
          The last opened stream of the current MDB.
static java.lang.String moreInfo
          The current TBS more information text
static java.lang.String tbsFullName
          The current full name of selected TBS
static java.lang.String unknownSmlMana
          The picture used for unknown mana cost value.
static java.lang.String unknownSmlManaHtml
          The picture used for unknown mana cost value.
static java.lang.String version
          The ciurrent TBS version
 
Method Summary
static void closeMdb()
          Close the current TBS.
static java.io.FileInputStream loadHeader(java.lang.String dbFile)
          Load author, tbs name,...
static java.io.FileInputStream loadMDB(java.lang.String dbFile, int firstPlayer)
          Load author, tbs name,...
static void loadTBSSettings()
          Loading the settings corresponding to the current TBS
static java.io.FileInputStream openMdb(java.lang.String dbStream, boolean forceRecheck)
          Check the given MDB file and update it if needed.
static java.io.FileInputStream resetMdb()
          Reset the given MDB stream to the first offset of card references.
static void saveTBSSettings()
          Save the settings corresponding to the current TBS
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tbsFullName

public static java.lang.String tbsFullName
The current full name of selected TBS


disclaimer

public static java.lang.String disclaimer
The current TBS disclaimer


moreInfo

public static java.lang.String moreInfo
The current TBS more information text


author

public static java.lang.String author
The current TBS comment


version

public static java.lang.String version
The ciurrent TBS version


artURL

public static java.lang.String artURL
Indicates where to find the art from a URL


backPicture

public static java.lang.String backPicture
Indicates the picture name of the back picture.


damagePicture

public static java.lang.String damagePicture
Indicates the picture name of the damage picture.


colorlessSmlManas

public static java.lang.String[] colorlessSmlManas
This is the defined colorless mana file names without basename. The base web basename is colorlessURL and the local basename is tbs/TBS_NAME/images/mana/colorless/

See Also:
colorlessSmlManas

colorlessSmlManasHtml

public static java.lang.String[] colorlessSmlManasHtml
This the HTML representation of defined small colorless manas.

See Also:
colorlessSmlManas

colorlessBigURL

public static java.lang.String colorlessBigURL
This is the filename without basename corresponding to the big colorless picture. The base web basename is colorlessURL and the local basename is tbs/TBS_NAME/images/mana/colorless/big/


coloredSmlManas

public static java.lang.String[] coloredSmlManas
This is the defined small colorled mana file names without basename. The base web basename is coloredManaSmlURL and the local basename is tbs/TBS_NAME/images/mana/colored/small/

See Also:
coloredManaSmlURL

coloredSmlManasHtml

public static java.lang.String[] coloredSmlManasHtml
This the HTML representation of defined small colorled manas.

See Also:
colorlessSmlManas

coloredBigManas

public static java.lang.String[] coloredBigManas
This is the defined small colorled mana file names without basename. The base web basename is coloredManaBigURL and the local basename is tbs/TBS_NAME/images/mana/colored/big/

See Also:
coloredManaBigURL

colorlessURL

public static java.lang.String colorlessURL
This is the web basename where colorless mana pictures can be found.


coloredManaSmlURL

public static java.lang.String coloredManaSmlURL
This is the web basename where small colorled mana pictures can be found.


coloredManaBigURL

public static java.lang.String coloredManaBigURL
This is the web basename where big colorled mana pictures can be found.


unknownSmlManaHtml

public static java.lang.String unknownSmlManaHtml
The picture used for unknown mana cost value.


unknownSmlMana

public static java.lang.String unknownSmlMana
The picture used for unknown mana cost value.


lastMdbStream

public static java.io.FileInputStream lastMdbStream
The last opened stream of the current MDB.

Method Detail

loadMDB

public static java.io.FileInputStream loadMDB(java.lang.String dbFile,
                                              int firstPlayer)
                                       throws java.io.IOException
Load author, tbs name,... Load the rules of this mdb and set them to the MP environment, set the current offset to the beginning of card section.

Parameters:
dbFile - the mdb file containing rules.
firstPlayer - the index of first player.
Returns:
the stream as is, the current offset correponds to the beginning of cards section.
Throws:
java.io.IOException - If some other I/O error occurs

resetMdb

public static java.io.FileInputStream resetMdb()
Reset the given MDB stream to the first offset of card references.

Returns:
the stream.

openMdb

public static java.io.FileInputStream openMdb(java.lang.String dbStream,
                                              boolean forceRecheck)
                                       throws java.io.IOException
Check the given MDB file and update it if needed. Then open it and return the created stream.

Parameters:
dbStream - the mdb file containing rules.
forceRecheck - if true, all files are checked even if it has already been done.
Returns:
return the opened stream as is when file is opened.
Throws:
java.io.IOException - If some other I/O error occurs

loadHeader

public static java.io.FileInputStream loadHeader(java.lang.String dbFile)
                                          throws java.io.IOException
Load author, tbs name,... Load the rules of this mdb and set them to the MP environment, set the current offset to the begin of card section and return it's position Load settings associated to this mdb.

Parameters:
dbFile - the mdb file containing rules.
Returns:
return the opened stream as is, the current offset correponds to the last byte read of the disclaimer/licence section.
Throws:
java.io.IOException - If some other I/O error occurs

saveTBSSettings

public static void saveTBSSettings()
Save the settings corresponding to the current TBS


loadTBSSettings

public static void loadTBSSettings()
Loading the settings corresponding to the current TBS


closeMdb

public static void closeMdb()
Close the current TBS.



Copyright © 2003-2007 Magic-Project. All Rights Reserved.