Merge branch 'master' of manuel-voegele.de:inf3
Conflicts: src/Parser.cs
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{FB0656B5-8E83-4880-9EAE-55E474B8B732}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
@@ -118,6 +118,7 @@
|
||||
</Compile>
|
||||
<Compile Include="src\BinarySearch.cs" />
|
||||
<Compile Include="src\Sorttest.cs" />
|
||||
<Compile Include="src\AI.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
||||
|
||||
24
src/AI.cs
Normal file
24
src/AI.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Timers;
|
||||
|
||||
namespace WorldOfPeacecraft
|
||||
{
|
||||
public class AI
|
||||
{
|
||||
Timer timer;
|
||||
bool challengeSomeone = false;
|
||||
|
||||
public AI ()
|
||||
{
|
||||
timer = new Timer (5000.0);
|
||||
timer.Elapsed += new ElapsedEventHandler (OnTimedEvent);
|
||||
timer.Start ();
|
||||
}
|
||||
|
||||
private static void OnTimedEvent(object source, ElapsedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,17 @@ namespace WorldOfPeacecraft
|
||||
public const string ValueY = "y";
|
||||
public const string ValueCol = "col";
|
||||
public const string ValueRow = "row";
|
||||
public const string EValueDragon = "DRAGON";
|
||||
public const string EValueStagunt = "STAGHUNT";
|
||||
public const string EValueSkirmish = "SKIRMISH";
|
||||
public const string EValueFight = "FIGHT";
|
||||
public const string EValueRest = "REST";
|
||||
public const string EValueStag = "STAG";
|
||||
public const string EValueBunny = "BUNNY";
|
||||
public const string EValueSword = "SWORD";
|
||||
public const string EValueMagic = "MAGIC";
|
||||
public const string EValueAlchemy = "ALCHEMY";
|
||||
public const string EValueWalkable = "WALKABLE";
|
||||
public const string EValueSkirmish = "SKIRMISH";
|
||||
public const string EValueStaghunt = "STAGHUNT";
|
||||
public const string EValueDragon = "DRAGON";
|
||||
public const string EValueWall = "WALL";
|
||||
public const string EValueForest = "FOREST";
|
||||
public const string EValueWater = "WATER";
|
||||
@@ -247,14 +254,31 @@ namespace WorldOfPeacecraft
|
||||
LinkedList <string> unnamedValue = oppBlock.GetUnnamedValues ();
|
||||
string stringValue = unnamedValue.First.Value;
|
||||
Decision d;
|
||||
if (stringValue == EValueDragon)
|
||||
d = Decision.DRAGON;
|
||||
else if (stringValue == EValueStagunt)
|
||||
d = Decision.STAGHUNT;
|
||||
else if (stringValue == EValueSkirmish)
|
||||
d = Decision.SKIRMISH;
|
||||
else
|
||||
switch (stringValue) {
|
||||
case EValueAlchemy:
|
||||
d = Decision.ALCHEMY;
|
||||
break;
|
||||
case EValueBunny:
|
||||
d = Decision.BUNNY;
|
||||
break;
|
||||
case EValueFight:
|
||||
d = Decision.FIGHT;
|
||||
break;
|
||||
case EValueMagic:
|
||||
d = Decision.MAGIC;
|
||||
break;
|
||||
case EValueRest:
|
||||
d = Decision.REST;
|
||||
break;
|
||||
case EValueStag:
|
||||
d = Decision.STAG;
|
||||
break;
|
||||
case EValueSword:
|
||||
d = Decision.SWORD;
|
||||
break;
|
||||
default:
|
||||
throw new ParsingException("Wrong param"); // TODO Better message
|
||||
}
|
||||
Opponent o = new Opponent (id, points, total, d);
|
||||
}
|
||||
|
||||
@@ -275,7 +299,7 @@ namespace WorldOfPeacecraft
|
||||
case EValueDragon:
|
||||
type = GameType.DRAGON;
|
||||
break;
|
||||
case EValueStagunt:
|
||||
case EValueStaghunt:
|
||||
type = GameType.STAGHUNT;
|
||||
break;
|
||||
case EValueSkirmish:
|
||||
|
||||
Reference in New Issue
Block a user