Esempio n. 1
0
        private static TryInterpretReturnValue DungeonOrDetailDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            if (column + 5 >= thisLineLength)
            {
                return(start.Fail(10));
            }
            else
            {
                switch (*++ccp)
                {
                case 'u':
                    if (column + 6 < thisLineLength && *++ccp == 'n' && *++ccp == 'g' && *++ccp == 'e' && *++ccp == 'o' && *++ccp == 'n' && IsNextEndOfLineOrSpace(ccp, column + 6, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 7, Location.Dungeon));
                    }
                    else
                    {
                        return(start.Fail(8));
                    }

                case 'e':
                    if (*++ccp == 't' && *++ccp == 'a' && *++ccp == 'i' && *++ccp == 'l' && IsNextEndOfLineOrSpace(ccp, column + 5, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 6, Location.Detail));
                    }
                    else
                    {
                        return(start.Fail(9));
                    }

                default:
                    return(start.Fail(10));
                }
            }
        }
Esempio n. 2
0
        private static TryInterpretReturnValue ClassOrContextDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            if (column + 4 >= thisLineLength)
            {
                return(start.Fail(13));
            }
            else
            {
                switch (*++ccp)
                {
                case 'o':
                    if (column + 6 < thisLineLength && *++ccp == 'n' && *++ccp == 't' && *++ccp == 'e' && *++ccp == 'x' && *++ccp == 't' && IsNextEndOfLineOrSpaceOrLeftBrace(ccp, column + 6, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 7, Location.Context));
                    }
                    else
                    {
                        return(start.Fail(12));
                    }

                case 'l':
                    if (*++ccp == 'a' && *++ccp == 's' && *++ccp == 's' && IsNextEndOfLineOrSpace(ccp, column + 4, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 5, Location.Class));
                    }
                    else
                    {
                        return(start.Fail(11));
                    }

                default:
                    return(start.Fail(13));
                }
            }
        }
Esempio n. 3
0
        private static TryInterpretReturnValue PowerDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            const int _length = 5;

            if (column + _length - 1 < thisLineLength && *++ccp == 'o' && *++ccp == 'w' && *++ccp == 'e' && *++ccp == 'r' && IsNextEndOfLineOrSpace(ccp, column + _length - 1, thisLineLength))
            {
                return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, _length, Location.Power));
            }
            else
            {
                return(start.Fail(0));
            }
        }
Esempio n. 4
0
        private static TryInterpretReturnValue UnitDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            const int _length = 4;

            if (column + _length - 1 < thisLineLength && *++ccp == 'n' && *++ccp == 'i' && *++ccp == 't' && IsNextEndOfLineOrSpace(ccp, column + _length - 1, thisLineLength))
            {
                return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, _length, Location.Unit));
            }
            else
            {
                return(start.Fail(1));
            }
        }
Esempio n. 5
0
        private static TryInterpretReturnValue FieldDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            const int _length = 5;
            const int _len1   = _length - 1;

            if (column + _len1 < thisLineLength && *++ccp == 'i' && *++ccp == 'e' && *++ccp == 'l' && *++ccp == 'd' && IsNextEndOfLineOrSpace(ccp, column + _len1, thisLineLength))
            {
                return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, _length, Location.Field));
            }
            else
            {
                return(start.Fail(4));
            }
        }
Esempio n. 6
0
        private static TryInterpretReturnValue MoveTypeDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            const int _length = 8;
            const int _len1   = _length - 1;

            if (column + _len1 < thisLineLength && *++ccp == 'o' && *++ccp == 'v' && *++ccp == 'e' && *++ccp == 't' && *++ccp == 'y' && *++ccp == 'p' && *++ccp == 'e' && IsNextEndOfLineOrSpace(ccp, column + _len1, thisLineLength))
            {
                return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, _length, Location.Movetype));
            }
            else
            {
                return(start.Fail(6));
            }
        }
Esempio n. 7
0
        private static TryInterpretReturnValue WorkspaceDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            const int _length = 9;
            const int _len1   = _length - 1;

            if (column + _len1 < thisLineLength && *++ccp == 'o' && *++ccp == 'r' && *++ccp == 'k' && *++ccp == 's' && *++ccp == 'p' && *++ccp == 'a' && *++ccp == 'c' && *++ccp == 'e' && IsNextEndOfLineOrSpace(ccp, column + _len1, thisLineLength))
            {
                return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, _length, Location.WorkSpace));
            }
            else
            {
                return(start.Fail(23));
            }
        }
Esempio n. 8
0
        private static TryInterpretReturnValue SDetect(this Caret start, int column, int thisLineLength, ushort *ccp)
        {
            if (column + 3 >= thisLineLength)
            {
                return(start.Fail(20));
            }
            else
            {
                switch (*++ccp)
                {
                case 'k':
                    if (column + 4 < thisLineLength && *++ccp == 'i' && *++ccp == 'l' && *++ccp == 'l')
                    {
                        if (IsNextEndOfLineOrSpace(ccp, column + 4, thisLineLength))
                        {
                            return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 5, Location.Skill));
                        }
                        else if (*++ccp == 's' && column + 7 < thisLineLength && *++ccp == 'e' && *++ccp == 't' && IsNextEndOfLineOrSpace(ccp, column + 7, thisLineLength))
                        {
                            return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 8, Location.SkillSet));
                        }
                        else
                        {
                            return(start.Fail(15));
                        }
                    }
                    else
                    {
                        return(start.Fail(16));
                    }

                case 'o':
                    if (column + 4 < thisLineLength && *++ccp == 'u' && *++ccp == 'n' && *++ccp == 'd' && IsNextEndOfLineOrSpaceOrLeftBrace(ccp, column + 4, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 5, Location.Sound));
                    }
                    else
                    {
                        return(start.Fail(17));
                    }

                case 't':
                    if (column + 4 < thisLineLength && *++ccp == 'o' && *++ccp == 'r' && *++ccp == 'y' && IsNextEndOfLineOrSpace(ccp, column + 4, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 5, Location.Story));
                    }
                    else
                    {
                        return(start.Fail(18));
                    }

                case 'c':
                    if (column + 7 < thisLineLength && *++ccp == 'e' && *++ccp == 'n' && *++ccp == 'a' && *++ccp == 'r' && *++ccp == 'i' && *++ccp == 'o' && IsNextEndOfLineOrSpace(ccp, column + 7, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 8, Location.Scenario));
                    }
                    else
                    {
                        return(start.Fail(19));
                    }

                case 'p':
                    if (*++ccp == 'o' && *++ccp == 't' && IsNextEndOfLineOrSpace(ccp, column + 3, thisLineLength))
                    {
                        return(TryInterpretReturnValue.CreateSuccessDetectStructType(start, 4, Location.Spot));
                    }
                    else
                    {
                        return(start.Fail(21));
                    }

                default:
                    return(start.Fail(20));
                }
            }
        }