public Event ParseEvent(string line)
        {
            Contract.Ensures(Contract.Result <Event>() != null);
            StringReader reader    = new StringReader(line);
            EventType    eventType = EnumDescriptionToValueMapper <EventType> .GetValueByDescription(reader.ReadWord());

            return(ParseEventBody(eventType, reader));
        }
Exemplo n.º 2
0
        public override void ReadFromStream(StringReader reader)
        {
            Type = EnumDescriptionToValueMapper <ScoreType> .GetValueByDescription(reader.ReadWord());

            switch (Type)
            {
            case ScoreType.Cp:
                CpScore = int.Parse(reader.ReadWord());
                break;

            case ScoreType.Mate:
                MateDepth = int.Parse(reader.ReadWord());
                break;
            }
        }
Exemplo n.º 3
0
        public override void ReadFromStream(StringReader reader)
        {
            string word;

            while ((word = reader.ReadWord()) != null)
            {
                if (word.Equals(String.Empty))
                {
                    continue;
                }
                TFieldType fieldId = EnumDescriptionToValueMapper <TFieldType> .GetValueByDescription(word);

                EventField field = CreateField(fieldId);
                field.ReadFromStream(reader);
                AddField(fieldId, field);
            }
        }
 public override void ReadFromStream(StringReader reader)
 {
     Value = EnumDescriptionToValueMapper <OptionType> .GetValueByDescription(reader.ReadWord());
 }