コード例 #1
0
        public void TestAnyMatcher()
        {
            var m = Matcher.Any(Matcher.Char('a'), Matcher.String("bc"));

            Assert.Equal(1, m.Match(new MatchContent("abc", 0, MatchDirection.Forward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 0, MatchDirection.Backward)));
            Assert.Equal(2, m.Match(new MatchContent("abc", 1, MatchDirection.Forward)));
            Assert.Equal(1, m.Match(new MatchContent("abc", 1, MatchDirection.Backward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 2, MatchDirection.Forward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 2, MatchDirection.Backward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 3, MatchDirection.Forward)));
            Assert.Equal(2, m.Match(new MatchContent("abc", 3, MatchDirection.Backward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("cba", 3, MatchDirection.Forward)));
            Assert.Equal(1, m.Match(new MatchContent("cba", 3, MatchDirection.Backward)));
            Assert.Equal(1, m.Match(new MatchContent("cba", 2, MatchDirection.Forward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("cba", 2, MatchDirection.Backward)));
        }
コード例 #2
0
 public static IAnyOfMatcher AnyOf <T1, T2, T3, T4, T5, T6>() where T1 : IComponent where T2 : IComponent where T3 : IComponent where T4 : IComponent where T5 : IComponent where T6 : IComponent
 {
     return(Matcher <C, T1, T2, T3, T4, T5, T6> .Any());
 }
コード例 #3
0
 public static IAnyOfMatcher AnyOf <T1, T2, T3>() where T1 : IComponent where T2 : IComponent where T3 : IComponent
 {
     return(Matcher <C, T1, T2, T3> .Any());
 }
コード例 #4
0
 public static IAnyOfMatcher AnyOf <T1>() where T1 : IComponent
 {
     return(Matcher <C, T1> .Any());
 }
コード例 #5
0
		public static IGroup AnyOf<T1, T2, T3, T4, T5, T6>() where T1 : IComponent where T2 : IComponent where T3 : IComponent where T4 : IComponent where T5 : IComponent where T6 : IComponent
		{ return Instance.GetGroup(Matcher<C, T1, T2, T3, T4, T5, T6>.Any()); }
コード例 #6
0
		public static IGroup AnyOf<T1, T2>() where T1 : IComponent where T2 : IComponent
		{ return Instance.GetGroup(Matcher<C, T1, T2>.Any()); }