Card erratas.

This commit is contained in:
marcins78@gmail.com
2012-04-09 13:03:32 +00:00
parent e64be4f178
commit d2f2997ec7
24 changed files with 38 additions and 16 deletions

View File

@@ -44,7 +44,6 @@ public class LeagueDAO {
PreparedStatement statement = conn.prepareStatement("select id, name, type, class, parameters, status, cost from league where end>=? order by start desc"); PreparedStatement statement = conn.prepareStatement("select id, name, type, class, parameters, status, cost from league where end>=? order by start desc");
try { try {
statement.setInt(1, currentTime); statement.setInt(1, currentTime);
statement.setInt(2, currentTime);
ResultSet rs = statement.executeQuery(); ResultSet rs = statement.executeQuery();
try { try {
List<League> activeLeagues = new ArrayList<League>(); List<League> activeLeagues = new ArrayList<League>();

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

View File

@@ -203,13 +203,33 @@ var Card = Class.extend({
var setNo = parseInt(blueprintId.substr(0, separator)); var setNo = parseInt(blueprintId.substr(0, separator));
var cardNo = parseInt(blueprintId.substr(separator + 1)); var cardNo = parseInt(blueprintId.substr(separator + 1));
var errata = this.getErrata(setNo, cardNo);
if (errata != null)
return errata;
var mainLocation = this.getMainLocation(setNo, cardNo); var mainLocation = this.getMainLocation(setNo, cardNo);
var cardStr;
if (this.isMasterworks(setNo, cardNo))
cardStr = this.formatSetNo(setNo) + "O0" + (cardNo - this.getMasterworksOffset(setNo));
else
cardStr = this.formatCardNo(setNo, cardNo);
return mainLocation + "LOTR" + cardStr + (this.isTengwar() ? "T" : "") + ".jpg";
},
formatSetNo: function(setNo) {
var setNoStr; var setNoStr;
if (setNo < 10) if (setNo < 10)
setNoStr = "0" + setNo; setNoStr = "0" + setNo;
else else
setNoStr = setNo; setNoStr = setNo;
return setNoStr;
},
formatCardNo: function(setNo, cardNo) {
var setNoStr = this.formatSetNo(setNo);
var cardStr; var cardStr;
if (cardNo < 10) if (cardNo < 10)
@@ -219,17 +239,11 @@ var Card = Class.extend({
else else
cardStr = setNoStr + "" + cardNo; cardStr = setNoStr + "" + cardNo;
if (this.isMasterworks(setNo, cardNo)) return cardStr;
cardStr = setNoStr + "O0" + (cardNo - this.getMasterworksOffset(setNo));
return mainLocation + "LOTR" + cardStr + (this.isTengwar() ? "T" : "") + ".jpg";
}, },
getMainLocation: function(setNo, cardNo) { getMainLocation: function(setNo, cardNo) {
if (this.isErrata(setNo, cardNo)) return "http://lotrtcgdb.com/images/";
return "/gemp-lotr/images/erratas/";
else
return "http://lotrtcgdb.com/images/";
}, },
getMasterworksOffset: function(setNo) { getMasterworksOffset: function(setNo) {
@@ -254,13 +268,22 @@ var Card = Class.extend({
return false; return false;
}, },
isErrata: function(setNo, cardNo) { pngErratas: {
if (setNo == 0) "1":[3,55,113,235,318],
return cardNo == 7; "3":[48],
else if (setNo == 1) "4":[236,237],
return cardNo == 12 || cardNo == 43 || cardNo == 46; "18":[8,12,25,35,48,50,77,78,79,80,94,97]
else },
return false;
getErrata: function(setNo, cardNo) {
if (setNo == 0 && cardNo == 7)
return "/gemp-lotr/images/erratas/LOTR00007.jpg";
if (setNo == 1 && (cardNo == 12 || cardNo == 43 || cardNo == 46))
return "/gemp-lotr/images/erratas/LOTR010" + cardNo + ".jpg";
if (this.pngErratas["" + setNo] != null && $.inArray(cardNo, this.pngErratas["" + setNo]) != -1)
return "/gemp-lotr/images/erratas/LOTR" + this.formatCardNo(setNo, cardNo) + ".png";
return null;
}, },
getHeightForWidth: function(width) { getHeightForWidth: function(width) {