New research and technology page
* Added legacyworlds-server-beans-technologies Maven module, including the player-level DAO and controller. * Added session classes to carry technology information, modified web client session façade accordingly * Various changes to common UI elements (forms, lists, etc...) so the start and end of some element can be drawn separately * Added controller, templates and JavaScript for research page
This commit is contained in:
parent
154f215e24
commit
6dcd59d7bc
45 changed files with 2314 additions and 178 deletions
legacyworlds-server-interfaces/src/main/java/com/deepclone/lw/interfaces/game
|
@ -23,9 +23,6 @@ public interface EmpireDAO
|
|||
public OverviewData getOverview( int empireId );
|
||||
|
||||
|
||||
public void implementTechnology( int empireId , int lineId );
|
||||
|
||||
|
||||
public List< PlanetListData > getPlanetList( int empireId );
|
||||
|
||||
|
||||
|
|
|
@ -22,9 +22,6 @@ public interface EmpireManagement
|
|||
public EmpireResponse getOverview( int empireId );
|
||||
|
||||
|
||||
public EmpireResponse implementTechnology( int empireId , int techId );
|
||||
|
||||
|
||||
public ListPlanetsResponse getPlanetList( int empireId );
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
package com.deepclone.lw.interfaces.game.technologies;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.deepclone.lw.cmd.player.gdata.empire.ResearchData;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Player-oriented data access interface for technologies
|
||||
*
|
||||
* @author <a href="mailto:tseeker@legacyworlds.com">E. Benoît</a>
|
||||
*/
|
||||
public interface PlayerTechnologiesDAO
|
||||
{
|
||||
|
||||
/**
|
||||
* Obtain the list of technologies for an empire
|
||||
*
|
||||
* <p>
|
||||
* Query the database for technology entries as seen from an empire's perspective. The
|
||||
* technologies will be returned with I18N string identifiers for categories, names and
|
||||
* descriptions (unless the details are not available).
|
||||
*
|
||||
* @param empire
|
||||
* the empire's identifier
|
||||
*
|
||||
* @return the list of technology entries
|
||||
*/
|
||||
public List< ResearchData > getResearchData( int empire );
|
||||
|
||||
|
||||
/**
|
||||
* Start a research priority update
|
||||
*
|
||||
* <p>
|
||||
* This method initialises a research priorities update by calling the appropriate stored
|
||||
* procedure.
|
||||
*
|
||||
* @param empire
|
||||
* the empire for which an update is being performed
|
||||
*
|
||||
* @return <code>true</code> on success, <code>false</code> on failure
|
||||
*/
|
||||
public boolean startPriorityUpdate( int empire );
|
||||
|
||||
|
||||
/**
|
||||
* Upload a single research priority
|
||||
*
|
||||
* <p>
|
||||
* This method uploads the priority for one of the in-progress research items. It must be called
|
||||
* only after a research priority update has been initiated.
|
||||
*
|
||||
* @param identifier
|
||||
* the technology's identifier
|
||||
* @param priority
|
||||
* the research priority
|
||||
*
|
||||
* @return <code>true</code> on success, <code>false</code> on failure
|
||||
*/
|
||||
public boolean uploadResearchPriority( String identifier , int priority );
|
||||
|
||||
|
||||
/**
|
||||
* Apply an in-progress research priority update
|
||||
*
|
||||
* <p>
|
||||
* This method applies a previously uploaded set of research priority updates.
|
||||
*
|
||||
* @return <code>true</code> on success, <code>false</code> on failure
|
||||
*/
|
||||
public boolean applyPriorityUpdate( );
|
||||
|
||||
|
||||
/**
|
||||
* Implement a technology
|
||||
*
|
||||
* <p>
|
||||
* This method calls the stored procedure which causes an empire to implement a technology.
|
||||
*
|
||||
* @param empire
|
||||
* the empire's identifier
|
||||
* @param technology
|
||||
* the technology's identifier
|
||||
*
|
||||
* @return <code>true</code> on success, <code>false</code> on failure
|
||||
*/
|
||||
public boolean implement( int empire , String technology );
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.deepclone.lw.interfaces.game.technologies;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.deepclone.lw.cmd.player.tech.GetResearchCommand;
|
||||
import com.deepclone.lw.cmd.player.tech.GetResearchResponse;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Research control interface
|
||||
*
|
||||
* <p>
|
||||
* This interface is implemented by the component which allows empires (and therefore players) to
|
||||
* view the research state and control it.
|
||||
*
|
||||
* @author <a href="mailto:tseeker@legacyworlds.com">E. Benoît</a>
|
||||
*/
|
||||
public interface ResearchController
|
||||
{
|
||||
|
||||
/**
|
||||
* Obtain the state of an empire's research
|
||||
*
|
||||
* <p>
|
||||
* This method must be overridden to generate the response to a {@link GetResearchCommand}.
|
||||
*
|
||||
* @param empire
|
||||
* the empire's identifier
|
||||
*
|
||||
* @return the appropriate {@link GetResearchResponse} instance
|
||||
*/
|
||||
public GetResearchResponse getResearchData( int empire );
|
||||
|
||||
|
||||
/**
|
||||
* Update research priorities
|
||||
*
|
||||
* <p>
|
||||
* This method must be implemented so it updates research priorities for an empire.
|
||||
*
|
||||
* @param empire
|
||||
* the empire to update
|
||||
* @param priorities
|
||||
* the new research priorities, as a map associating technology identifiers to
|
||||
* priority values
|
||||
*
|
||||
* @return <code>true</code> on success, <code>false</code> otherwise
|
||||
*/
|
||||
public boolean updatePriorities( int empire , Map< String , Integer > priorities );
|
||||
|
||||
|
||||
/**
|
||||
* Implement a technology
|
||||
*
|
||||
* <p>
|
||||
* This method implements a technology which has been fully researched.
|
||||
*
|
||||
* @param empire
|
||||
* the empire trying to implement a technology
|
||||
* @param technology
|
||||
* the technology's identifier
|
||||
*
|
||||
* @return <code>true</code> on success, <code>false</code> otherwise
|
||||
*/
|
||||
public boolean implement( int empire , String technology );
|
||||
|
||||
}
|
Reference in a new issue