예제 #1
0
파일: StrokeUnit.cs 프로젝트: ttrr1/Midea
        internal static StrokeUnit Deserialize(BinaryReader binaryReader)
        {
            StrokeUnit unit = new StrokeUnit();

            unit.StrokeNumber = binaryReader.ReadByte();
            unit.CharCount    = binaryReader.ReadInt16();
            unit.CharList     = new char[unit.CharCount];
            for (int i = 0; i < unit.CharCount; i++)
            {
                unit.CharList[i] = binaryReader.ReadChar();
            }
            return(unit);
        }
예제 #2
0
        internal static StrokeDictionary Deserialize(BinaryReader binaryReader)
        {
            StrokeDictionary dictionary = new StrokeDictionary();

            binaryReader.ReadInt32();
            dictionary.Length = binaryReader.ReadInt32();
            dictionary.Count  = binaryReader.ReadInt32();
            dictionary.Offset = binaryReader.ReadInt16();
            binaryReader.ReadBytes(0x18);
            dictionary.StrokeUnitTable = new List <StrokeUnit>();
            for (int i = 0; i < dictionary.Count; i++)
            {
                dictionary.StrokeUnitTable.Add(StrokeUnit.Deserialize(binaryReader));
            }
            binaryReader.ReadInt16();
            return(dictionary);
        }
예제 #3
0
 internal bool Match(StrokeUnit strokeUnit)
 {
     return(strokeUnit.StrokeNumber == this.ExpectedStrokeNum);
 }