From ef9fe6627ec258fb8e6ea7e8e7f6ae7c2bd7c9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Thu, 10 Apr 2014 10:17:27 +0200 Subject: [PATCH] =?UTF-8?q?Parser=20erkennt=20jetzt=20auch=20Werte=20ohne?= =?UTF-8?q?=20namen=20innerhalb=20von=20bl=C3=B6cken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Parser.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Parser.cs b/src/Parser.cs index bb473b8..84146a4 100644 --- a/src/Parser.cs +++ b/src/Parser.cs @@ -288,6 +288,7 @@ namespace WorldOfPeacecraft private string Name; private LinkedList Blocks = new LinkedList (); private Dictionary Values = new Dictionary (); + private string UnnamedValue; public Block (String[] message, int start, int end) { @@ -310,13 +311,17 @@ namespace WorldOfPeacecraft begins++; } Blocks.AddLast (new Block (message, blockstart, pos)); - } else { + } else if (message[pos].Contains(":")) { // It's a value string name = StringUtils.SubstringBefore (message [pos], ":"); string val = StringUtils.SubstringAfter (message [pos], ":"); Values [name] = val; pos++; } + else { + UnnamedValue = message[pos]; + pos++; + } } } @@ -325,6 +330,11 @@ namespace WorldOfPeacecraft return Name; } + public string GetUnnamedValue() + { + return UnnamedValue; + } + public LinkedList GetBlocks () { return Blocks;