Opponent erzeugt
This commit is contained in:
@@ -30,6 +30,8 @@ namespace WorldOfPeacecraft
|
||||
private Regex LastLineRegex;
|
||||
private Backend backend;
|
||||
|
||||
enum Decision {DRAGON, STAGHUNT, SKIRMISH};
|
||||
|
||||
public Parser ()
|
||||
{
|
||||
ParserThread = new Thread (new ThreadStart (this.RunParser));
|
||||
@@ -206,19 +208,28 @@ namespace WorldOfPeacecraft
|
||||
int round = procBlock.GetIntValue ("round");
|
||||
bool running = procBlock.GetBoolValue ("running");
|
||||
int delay = procBlock.GetIntValue ("delay");
|
||||
//ProcessOpponent (procBlock.GetBlocks ());
|
||||
LinkedList <Block> block = procBlock.GetBlocks ();
|
||||
ProcessOpponent (block.First.Value);
|
||||
//Result r = new Result(round, running, delay);
|
||||
}
|
||||
|
||||
private void ProcessOpponent(Block oppBlock)
|
||||
{
|
||||
CheckBlocksSize (oppBlock, 1, 1);
|
||||
int id = oppBlock.GetIntValue ("id");
|
||||
int points = oppBlock.GetIntValue ("points");
|
||||
int total = oppBlock.GetIntValue ("total");
|
||||
//TYPE decision = ProcessDecision(oppBlock.getBlocks());
|
||||
LinkedList <string> unnamedValue = oppBlock.GetUnnamedValues ();
|
||||
string stringValue = unnamedValue.First.Value;
|
||||
Decision d;
|
||||
if (stringValue == "DRAGON")
|
||||
d = Decision.DRAGON;
|
||||
if (stringValue == "STAGHUNT")
|
||||
d = Decision.STAGHUNT;
|
||||
if (stringValue == "SKIRMISH")
|
||||
d = Decision.SKIRMISH;
|
||||
|
||||
}
|
||||
//"id:"INT,"decision:",DECISION,"points:",INT,"total:",INT,"
|
||||
//DRAGON|STAGHUNT|SKIRMISH
|
||||
|
||||
private void ProcessDecision(Block block)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user