public PairService(IPairRepository pairRepository, IPairFactory pairFactory, ICorrelationContext correlationContext, IUserRepository userRepository)
 {
     _pairRepository     = pairRepository ?? throw new ArgumentNullException(nameof(pairRepository));
     _pairFactory        = pairFactory ?? throw new ArgumentNullException(nameof(pairFactory));
     _correlationContext = correlationContext ?? throw new ArgumentNullException(nameof(correlationContext));
     _userRepository     = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
 }
Ejemplo n.º 2
0
 public DefendBarrackRule(ComponentService componentService, AIDto ai, Vector2Service vector2Service, IPairFactory pairFactory, IEventStoreService eventStoreService)
 {
     _componentService = componentService;
     _ai = ai;
     _vector2Service = vector2Service;
     _pairFactory = pairFactory;
     _eventStoreService = eventStoreService;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates instance of the <see cref="Parser"/>.
 /// </summary>
 /// <param name="input">Stream of characters for parsing.</param>
 /// <param name="pairFactory">Pair factory is used to create DOM structure of the Syntactik document.</param>
 /// <param name="root"><see cref="DOM.Module"/> object is used as root of DOM structure.</param>
 /// <param name="processJsonBrackets">If true, parser will process {} and [] brackets.</param>
 public Parser(ICharStream input, IPairFactory pairFactory, DOM.Module root, bool processJsonBrackets = false)
 {
     _input       = input;
     _pairFactory = pairFactory;
     _pairStack   = new Stack <PairIndentInfo>();
     _pairStack.Push(new PairIndentInfo {
         Pair = root
     });
     _module = root;
     _processJsonBrackets = processJsonBrackets;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Consumes comments till EOL or EOF.
 /// </summary>
 public static bool ConsumeComments(this ICharStream stream, IPairFactory pairFactory, Pair parent)
 {
     if (stream.ConsumeSlComment(pairFactory, parent))
     {
         return(true);
     }
     if (stream.ConsumeMlComment(pairFactory, parent))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 5
0
        public static bool ConsumeMlComment(this ICharStream stream, IPairFactory pairFactory, Pair parent)
        {
            if (stream.Next != '\"')
            {
                return(false);
            }
            if (stream.La(2) != '\"')
            {
                return(false);
            }
            if (stream.La(3) != '\"')
            {
                return(false);
            }

            stream.Consume();
            var begin = new CharLocation(stream);

            stream.Consume();
            stream.Consume();
            while (!(stream.Next == '\"' && stream.La(2) == '\"' && stream.La(3) == '\"') && stream.Next != -1)
            {
                stream.Consume();
            }

            if (stream.Next == '\"')
            {
                stream.Consume();
                stream.Consume();
                stream.Consume();
            }
            var comment = pairFactory.ProcessComment((ITextSource)stream, 2, new Interval(begin, new CharLocation(stream)));

            if (comment != null)
            {
                pairFactory.AppendChild(parent, comment);
            }
            return(true);
        }
Ejemplo n.º 6
0
        public static bool ConsumeSlComment(this ICharStream stream, IPairFactory pairFactory, Pair parent)
        {
            if (stream.Next != '\'')
            {
                return(false);
            }
            if (stream.La(2) != '\'')
            {
                return(false);
            }
            if (stream.La(3) != '\'')
            {
                return(false);
            }

            stream.Consume();
            var begin = new CharLocation(stream);

            stream.Consume();
            stream.Consume();
            var c = stream.Next;

            while (!c.IsNewLineCharacter() && c != -1)
            {
                stream.Consume();
                c = stream.Next;
            }

            var comment = pairFactory.ProcessComment((ITextSource)stream, 1, new Interval(begin, new CharLocation(stream)));

            if (comment != null)
            {
                pairFactory.AppendChild(parent, comment);
            }
            return(true);
        }
 public GetEnemysAroundUnitStrategy(ComponentService componentService, Vector2Service vector2Service, IPairFactory pairFactory)
 {
     _componentService = componentService;
     _vector2Service = vector2Service;
     _pairFactory = pairFactory;
 }