Compilefehler beseitigt
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user