Removed client-side display for old technology system
* Removed data classes and database access that were used to display technology information * Removed "Research" tab from Overview page on the web client
This commit is contained in:
parent
9a7bc03171
commit
154f215e24
10 changed files with 2 additions and 492 deletions
legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire
|
@ -4,9 +4,7 @@ package com.deepclone.lw.beans.empire;
|
|||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
@ -20,8 +18,6 @@ import com.deepclone.lw.cmd.player.gdata.NameIdPair;
|
|||
import com.deepclone.lw.cmd.player.gdata.PlanetListData;
|
||||
import com.deepclone.lw.cmd.player.gdata.empire.OverviewData;
|
||||
import com.deepclone.lw.interfaces.game.EmpireDAO;
|
||||
import com.deepclone.lw.sqld.game.EmpireTechLine;
|
||||
import com.deepclone.lw.sqld.game.EmpireTechnology;
|
||||
import com.deepclone.lw.sqld.game.GeneralInformation;
|
||||
import com.deepclone.lw.utils.StoredProc;
|
||||
|
||||
|
@ -145,58 +141,6 @@ public class EmpireDAOBean
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List< EmpireTechLine > getTechnology( int empireId )
|
||||
{
|
||||
String sql = "SELECT * FROM emp.tech_lines_view WHERE empire = ?";
|
||||
RowMapper< EmpireTechLine > lineMapper = new RowMapper< EmpireTechLine >( ) {
|
||||
@Override
|
||||
public EmpireTechLine mapRow( ResultSet rs , int rowNum )
|
||||
throws SQLException
|
||||
{
|
||||
EmpireTechLine etl = new EmpireTechLine( );
|
||||
etl.setId( rs.getInt( "tech_line" ) );
|
||||
etl.setName( rs.getString( "name" ) );
|
||||
etl.setDescription( rs.getString( "description" ) );
|
||||
return etl;
|
||||
}
|
||||
};
|
||||
|
||||
List< EmpireTechLine > lines = this.dTemplate.query( sql , lineMapper , empireId );
|
||||
if ( lines.isEmpty( ) ) {
|
||||
return lines;
|
||||
}
|
||||
|
||||
Map< Integer , EmpireTechLine > linesById = new HashMap< Integer , EmpireTechLine >( );
|
||||
for ( EmpireTechLine etl : lines ) {
|
||||
linesById.put( etl.getId( ) , etl );
|
||||
}
|
||||
|
||||
sql = "SELECT * FROM emp.technologies_view WHERE empire = ?";
|
||||
RowMapper< EmpireTechnology > techMapper = new RowMapper< EmpireTechnology >( ) {
|
||||
@Override
|
||||
public EmpireTechnology mapRow( ResultSet rs , int rowNum )
|
||||
throws SQLException
|
||||
{
|
||||
EmpireTechnology et = new EmpireTechnology( );
|
||||
et.setLine( rs.getInt( "tech_line" ) );
|
||||
et.setName( rs.getString( "name" ) );
|
||||
et.setDescription( rs.getString( "description" ) );
|
||||
et.setImplemented( rs.getBoolean( "implemented" ) );
|
||||
et.setProgress( (int) rs.getDouble( "progress" ) );
|
||||
et.setCost( rs.getInt( "cost" ) );
|
||||
return et;
|
||||
}
|
||||
};
|
||||
|
||||
for ( EmpireTechnology et : this.dTemplate.query( sql , techMapper , empireId ) ) {
|
||||
linesById.get( et.getLine( ) ).addTechnology( et );
|
||||
}
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void implementTechnology( int empireId , int lineId )
|
||||
{
|
||||
|
|
|
@ -21,8 +21,6 @@ import com.deepclone.lw.cmd.player.gdata.PlanetListData;
|
|||
import com.deepclone.lw.cmd.player.gdata.PlanetListResourceRecord;
|
||||
import com.deepclone.lw.cmd.player.gdata.battles.BattleListEntry;
|
||||
import com.deepclone.lw.cmd.player.gdata.empire.OverviewData;
|
||||
import com.deepclone.lw.cmd.player.gdata.empire.ResearchLineData;
|
||||
import com.deepclone.lw.cmd.player.gdata.empire.TechnologyData;
|
||||
import com.deepclone.lw.interfaces.acm.UsersDAO;
|
||||
import com.deepclone.lw.interfaces.game.BattlesCache;
|
||||
import com.deepclone.lw.interfaces.game.BattlesDAO;
|
||||
|
@ -33,8 +31,6 @@ import com.deepclone.lw.interfaces.naming.NamingDAO;
|
|||
import com.deepclone.lw.interfaces.prefs.AccountPreferences;
|
||||
import com.deepclone.lw.interfaces.prefs.PreferencesDAO;
|
||||
import com.deepclone.lw.sqld.accounts.Account;
|
||||
import com.deepclone.lw.sqld.game.EmpireTechLine;
|
||||
import com.deepclone.lw.sqld.game.EmpireTechnology;
|
||||
import com.deepclone.lw.sqld.game.GeneralInformation;
|
||||
import com.deepclone.lw.sqld.game.battle.BattleListRecord;
|
||||
import com.deepclone.lw.utils.EmailAddress;
|
||||
|
@ -125,25 +121,6 @@ public class EmpireManagementBean
|
|||
public EmpireResponse getOverview( int empireId )
|
||||
{
|
||||
OverviewData overview = this.empireDao.getOverview( empireId );
|
||||
List< ResearchLineData > research = new LinkedList< ResearchLineData >( );
|
||||
|
||||
for ( EmpireTechLine etl : this.empireDao.getTechnology( empireId ) ) {
|
||||
List< TechnologyData > implemented = new LinkedList< TechnologyData >( );
|
||||
TechnologyData current = null;
|
||||
|
||||
for ( EmpireTechnology et : etl.getTechnologies( ) ) {
|
||||
if ( et.isImplemented( ) ) {
|
||||
implemented.add( new TechnologyData( et.getName( ) , et.getDescription( ) ) );
|
||||
} else if ( et.getProgress( ) == 100 ) {
|
||||
current = new TechnologyData( et.getName( ) , et.getDescription( ) , 100 , et.getCost( ) );
|
||||
} else {
|
||||
current = new TechnologyData( et.getName( ) , et.getDescription( ) , et.getProgress( ) );
|
||||
}
|
||||
}
|
||||
|
||||
research.add( new ResearchLineData( etl.getId( ) , etl.getName( ) , etl.getDescription( ) , implemented ,
|
||||
current ) );
|
||||
}
|
||||
|
||||
List< BattleListEntry > battles = new LinkedList< BattleListEntry >( );
|
||||
for ( BattleListRecord record : this.battlesDao.getBattles( empireId ) ) {
|
||||
|
@ -165,7 +142,7 @@ public class EmpireManagementBean
|
|||
|
||||
overview.setEconomy( this.resourcesInformationDao.getEmpireInformation( empireId ) );
|
||||
|
||||
return new EmpireResponse( this.getGeneralInformation( empireId ) , overview , research , battles );
|
||||
return new EmpireResponse( this.getGeneralInformation( empireId ) , overview , battles );
|
||||
}
|
||||
|
||||
|
||||
|
|
Reference in a new issue