net.sf.juoserver.model
Class CoreImpl

java.lang.Object
  extended by net.sf.juoserver.model.CoreImpl
All Implemented Interfaces:
Core

public class CoreImpl
extends Object
implements Core

The Core facade.

Holds information about everything: tiles, mobiles, etc.


Field Summary
static int ITEMS_MAX_SERIAL_ID
           
 
Constructor Summary
CoreImpl()
           
 
Method Summary
 void addAccount(Account account)
          Adds an account.
 void addMobile(Mobile mobile)
          Adds a mobile.
 boolean authenticate(Account account, String password)
          Attempts to authenticate the given account with the specified password.
 Account findAccountByUsername(String username)
          Retrieves an Account by username and password; the password is needed to check the credentials.
 Item findItemByID(int serialID)
          Retrieves an Item by its serial ID.
 Mobile findMobileByID(int serialID)
          Retrieves a Mobile by its serial ID.
 Configuration getConfiguration()
           
 FileReadersFactory getFileReadersFactory()
           
 MapTile getTile(int x, int y)
          Retrieves the map tile definition of the given coordinates.
 void init()
          Initializes the core.
 void setConfiguration(Configuration configuration)
           
 void setFileReadersFactory(FileReadersFactory fileReadersFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITEMS_MAX_SERIAL_ID

public static final int ITEMS_MAX_SERIAL_ID
See Also:
Constant Field Values
Constructor Detail

CoreImpl

public CoreImpl()
Method Detail

init

public void init()
Description copied from interface: Core
Initializes the core.

Specified by:
init in interface Core

addMobile

public void addMobile(Mobile mobile)
Description copied from interface: Core
Adds a mobile.

Specified by:
addMobile in interface Core
Parameters:
mobile - the mobile

getTile

public MapTile getTile(int x,
                       int y)
Retrieves the map tile definition of the given coordinates.

Specified by:
getTile in interface Core
Parameters:
x - X coordinate
y - Y coordinate
Returns:
the map tile definition of the given coordinates

findMobileByID

public Mobile findMobileByID(int serialID)
Description copied from interface: Core
Retrieves a Mobile by its serial ID.

Specified by:
findMobileByID in interface Core
Parameters:
serialID - Mobile's serial ID
Returns:
the Mobile with the specified serial ID, or null if there is no such Mobile

findItemByID

public Item findItemByID(int serialID)
Description copied from interface: Core
Retrieves an Item by its serial ID.

Specified by:
findItemByID in interface Core
Parameters:
serialID - Item's serial ID
Returns:
the Item with the specified serial ID, or null if there is no such Item

findAccountByUsername

public Account findAccountByUsername(String username)
Retrieves an Account by username and password; the password is needed to check the credentials.

Specified by:
findAccountByUsername in interface Core
Parameters:
username - username
Returns:
the Account matching the provided username, or null if no such account could be found

addAccount

public void addAccount(Account account)
Description copied from interface: Core
Adds an account.

Specified by:
addAccount in interface Core
Parameters:
account - the account

authenticate

public boolean authenticate(Account account,
                            String password)
Attempts to authenticate the given account with the specified password.

Specified by:
authenticate in interface Core
Parameters:
account - account
password - password
Returns:
true if and only if the account could be authenticated with the provided password

getConfiguration

public Configuration getConfiguration()

setConfiguration

public void setConfiguration(Configuration configuration)

getFileReadersFactory

public FileReadersFactory getFileReadersFactory()

setFileReadersFactory

public void setFileReadersFactory(FileReadersFactory fileReadersFactory)


Copyright © 2010-2012. All Rights Reserved.