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

@@ -65,9 +65,9 @@
<Compile Include="src\Result.cs" /> <Compile Include="src\Result.cs" />
<Compile Include="src\Challenge.cs" /> <Compile Include="src\Challenge.cs" />
<Compile Include="src\YourID.cs" /> <Compile Include="src\YourID.cs" />
<Compile Include="src\DefaultGui\Time.cs" />
<Compile Include="src\DefaultGui\Online.cs" />
<Compile Include="src\EnumDecision.cs" /> <Compile Include="src\EnumDecision.cs" />
<Compile Include="src\Online.cs" />
<Compile Include="src\Time.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
</Project> </Project>

View File

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