Empire mining settings

* Modified mining settings stored procedures to use text identifiers
instead of numeric identifiers

* Added DAO for mining settings and controller for resource operations

* Added UpdateEmpireMiningSettingsCommand and associated command
delegate. The command always returns NullResponse.

* Overview page templates split into multiple files for clarity, added
priority update form to the empire economy view and associated web
server handler
This commit is contained in:
Emmanuel BENOîT 2012-02-05 10:10:43 +01:00
parent 92dd01ffce
commit d38576a5cf
24 changed files with 1024 additions and 160 deletions
legacyworlds-server-interfaces/src/main/java/com/deepclone/lw/interfaces/game/resources

View file

@ -0,0 +1,60 @@
package com.deepclone.lw.interfaces.game.resources;
/**
* Data access object for mining settings
*
* <p>
* This interface provides methods which call stored procedures that control mining settings for
* both empires and planets.
*
* @author <a href="mailto:tseeker@legacyworlds.com">E. Benoît</a>
*/
public interface MiningSettingsDAO
{
/**
* Start an empire settings update
*
* <p>
* Start an empire settings update by calling the <code>emp.mset_update_start(INT)</code> stored
* procedure.
*
* @param empireId
* the identifier of the empire whose settings will be updated
*
* @return <code>true</code> on success, <code>false</code> on failure
*/
public boolean startUpdate( int empireId );
/**
* Set the new extraction priority of a resource
*
* <p>
* Call the <code>emp.mset_update_set(TEXT,INT)</code> stored procedure to set the new
* extraction priority for some type of resources. An mining settings update (empire- or
* planet-wide) must have been initiated before this method is called.
*
* @param resource
* the identifier of the resource
* @param priority
* the new extraction priority for the resource
*
* @return <code>true</code> on success, <code>false</code> if the resource did not exist.
*/
public boolean setNewPriority( String resource , int priority );
/**
* Apply the current settings update
*
* <p>
* This method applies a previously initiated mining settings update by calling the
* <code>emp.mset_update_apply()</code> stored procedure.
*
* @return <code>true</code> on success, <code>false</code> if one of the priorities was
* invalid.
*/
public boolean applyUpdate( );
}

View file

@ -0,0 +1,30 @@
package com.deepclone.lw.interfaces.game.resources;
import java.util.Map;
/**
* Resources control interface
*
* <p>
* This interface corresponds to the component which controls resources from the game's point of
* view. It contains methods that update mining settings.
*
* @author <a href="mailto:tseeker@legacyworlds.com">E. Benoît</a>
*/
public interface ResourcesController
{
/**
* Update an empire's mining settings
*
* @param empireId
* the empire's identifier
* @param settings
* the new settings
*/
public void updateEmpireSettings( int empireId , Map< String , Integer > settings );
}