New formats for league.

This commit is contained in:
marcins78@gmail.com
2012-05-10 10:07:57 +00:00
parent 8da6b7d803
commit f23b97e040
3 changed files with 66 additions and 0 deletions

View File

@@ -56,6 +56,33 @@
"banned": ["1_40","1_45","1_80","1_108","1_139","1_234","1_248","1_313","2_32","2_101","2_108","3_38","3_42","3_68","4_192"],
"set":[1,2,3,4,5,6]
},
{
"name": "Towers standard - Sets 1-4",
"code":"ttt_standard",
"sites": "TWO_TOWERS",
"cancelRingBearerSkirmish": true,
"banned": ["1_40","1_45","1_80","1_108","1_139","1_234","1_248","1_313","2_32","2_101","2_108","3_38","3_42","3_68","4_192"],
"set":[1,2,3,4],
"hall": false
},
{
"name": "Towers standard - Sets 1-5",
"code":"bohd_standard",
"sites": "TWO_TOWERS",
"cancelRingBearerSkirmish": true,
"banned": ["1_40","1_45","1_80","1_108","1_139","1_234","1_248","1_313","2_32","2_101","2_108","3_38","3_42","3_68","4_192"],
"set":[1,2,3,4,5],
"hall": false
},
{
"name": "Towers standard - Sets 1-6,9,14&16",
"code":"ts_reflections",
"sites": "TWO_TOWERS",
"cancelRingBearerSkirmish": false,
"banned": ["1_40","1_45","1_80","1_108","1_139","1_234","1_248","1_313","2_32","2_101","2_108","3_38","3_42","3_68","4_192"],
"set":[1,2,3,4,5,6,9,14,16],
"hall": false
},
{
"name": "King block",
"code": "king_block",

View File

@@ -74,6 +74,42 @@ public class HallResource extends AbstractResource {
return result.toString();
}
@Path("/format/{format}")
@GET
@Produces(MediaType.TEXT_HTML)
public String getFormat(
@PathParam("format") String format,
@Context HttpServletResponse response) {
response.setCharacterEncoding("UTF-8");
StringBuilder result = new StringBuilder();
LotroFormat lotroFormat = _formatLibrary.getFormat(format);
result.append("<b>" + lotroFormat.getName() + "</b>");
result.append("<ul>");
result.append("<li>valid sets: ");
for (Integer integer : lotroFormat.getValidSets())
result.append(integer + ", ");
result.append("</li>");
result.append("<li>sites from block: " + lotroFormat.getSiteBlock().getHumanReadable() + "</li>");
result.append("<li>Ring-bearer skirmish can be cancelled: " + (lotroFormat.canCancelRingBearerSkirmish() ? "yes" : "no") + "</li>");
result.append("<li>X-listed: ");
for (String blueprintId : lotroFormat.getBannedCards())
result.append(GameUtils.getCardLink(blueprintId, _library.getLotroCardBlueprint(blueprintId)) + ", ");
if (lotroFormat.getBannedCards().size() == 0)
result.append("none,");
result.append("</li>");
result.append("<li>R-listed: ");
for (String blueprintId : lotroFormat.getRestrictedCards())
result.append(GameUtils.getCardLink(blueprintId, _library.getLotroCardBlueprint(blueprintId)) + ", ");
if (lotroFormat.getRestrictedCards().size() == 0)
result.append("none,");
result.append("</li>");
result.append("</ul>");
return result.toString();
}
@GET
@Produces(MediaType.APPLICATION_XML)
public Document getHall(

View File

@@ -199,6 +199,9 @@
<option value="ttt1_block">Towers block - Set 4</option>
<option value="ttt2_block">Towers block - Sets 4&5</option>
<option value="towers_standard">Towers standard</option>
<option value="ttt_standard">Towers standard - Sets 1-4</option>
<option value="bohd_standard">Towers standard - Sets 1-5</option>
<option value="ts_reflections">Towers standard - Sets 1-6,9,14&16</option>
<option value="king_block">King block</option>
<option value="movie">Movie block</option>
<option value="movie7">Movie block - Sets 1-7</option>