Compilefehler beseitigt

This commit is contained in:
2014-04-11 12:05:16 +02:00
parent eebfeba568
commit 1888ef1393
2 changed files with 21 additions and 14 deletions

View File

@@ -226,10 +226,12 @@ namespace WorldOfPeacecraft
Decision d;
if (stringValue == "DRAGON")
d = Decision.DRAGON;
if (stringValue == "STAGHUNT")
else if (stringValue == "STAGHUNT")
d = Decision.STAGHUNT;
if (stringValue == "SKIRMISH")
else if (stringValue == "SKIRMISH")
d = Decision.SKIRMISH;
else
throw new ParsingException("Wrong param"); // TODO Better message
Opponent o = new Opponent (id, points, total, d);
}
@@ -243,17 +245,22 @@ namespace WorldOfPeacecraft
{
int id = challengeBlock.GetIntValue("id");
String type;
switch (challengeBlock.GetStringValue())
LinkedList<string> value = challengeBlock.GetUnnamedValues();
// TODO check value size, better name
switch (value.First.Value)
{
case "DRAGON":
type = "Dragon";
break;
case "STAGHUNT":
type = "Staghunt";
break;
case "SKIRMISCH":
type = "Skirmisch";
break;
case "DRAGON":
type = "Dragon";
break;
case "STAGHUNT":
type = "Staghunt";
break;
case "SKIRMISCH":
type = "Skirmisch";
break;
default:
throw new ParsingException("Invalid type"); // TODO Better message
break;
}
bool accepted = challengeBlock.GetBoolValue("accepted");
Challenge c = new Challenge(id, type, accepted);