public void AddClassFilter(IReferenceType referenceType)
        {
            ReferenceType type = referenceType as ReferenceType;

            if (type == null || !type.VirtualMachine.Equals(this.VirtualMachine))
            {
                throw new VirtualMachineMismatchException();
            }

            Modifiers.Add(Types.EventRequestModifier.ClassTypeFilter(type.ReferenceTypeId));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fluent (returns itself), add a lexica to the sentence, sentence logic applies here
        /// </summary>
        /// <param name="lex"></param>
        /// <returns></returns>
        public ILexicalSentence AddEvent(ISensoryEvent lex, bool recursive = true)
        {
            lex.Event.Context.Language = Language;

            //Contractive rules
            IDictata lexDict = lex.Event.GetDictata();

            foreach (IContractionRule contractionRule in Language.ContractionRules.Where(rul => rul.First == lexDict || rul.Second == lexDict))
            {
                if (!lex.Event.Modifiers.Any(mod => contractionRule.First.Equals(mod.GetDictata()) || contractionRule.Second.Equals(mod.GetDictata())))
                {
                    continue;
                }

                lex.Event.Modifiers.RemoveWhere(mod => contractionRule.First.Equals(mod.GetDictata()) || contractionRule.Second.Equals(mod.GetDictata()));

                lex.Event.Phrase = contractionRule.Contraction.Name;
            }

            //Sentence placement rules
            SentenceGrammarRule rule = Language.SentenceRules.FirstOrDefault(rul => rul.Type == Type && rul.Fragment == lex.Event.Role);

            if (rule != null)
            {
                //subject
                if (rule.SubjectPredicate)
                {
                    Subject.Add(new Tuple <ISensoryEvent, short>(lex, rule.ModificationOrder));
                }
                else
                {
                    Predicate.Add(new Tuple <ISensoryEvent, short>(lex, rule.ModificationOrder));
                }
            }
            else
            {
                Modifiers.Add(new Tuple <ISensoryEvent, short>(lex, 99));
            }

            if (recursive)
            {
                HashSet <ILexica> newMods = new HashSet <ILexica>();
                foreach (ILexica mod in lex.Event.Modifiers.Where(mod => mod.Role != GrammaticalType.None && mod.Role != GrammaticalType.Descriptive))
                {
                    AddEvent(new SensoryEvent(mod, lex.Strength, lex.SensoryType));
                    newMods.Add(mod);
                }

                lex.Event.Modifiers.RemoveWhere(modi => newMods.Any(mods => mods.Equals(modi)));
            }

            return(this);
        }
Ejemplo n.º 3
0
        public void Copy(Card target, IResolvable source)
        {
            // Can't copy itself
            if (target == this)
            {
                return;
            }

            while (target.IsCopying != null)
            {
                target = target.IsCopying;
            }

            IsCopying     = target;
            copyingSource = source;

            Modifiers.Add(new StringModifier(source, nameof(Name), target.Name));
            Modifiers.Add(new StringModifier(source, nameof(Text), target.Text));
            Modifiers.Add(new StringModifier(source, nameof(FlavorText), target.FlavorText));
            Modifiers.Add(new BooleanModifier(source, nameof(IsLegendary), target.IsLegendary));
            Modifiers.Add(new BooleanModifier(source, nameof(IsSnow), target.IsSnow));
            Modifiers.Add(new CostModifier(source, nameof(Cost), target.Cost.Copy(this)));

            Modifiers.Add(new PowerToughnessModifier(source, nameof(BasePowerFunc), target.BasePowerFunc));
            Modifiers.Add(new PowerToughnessModifier(source, nameof(BaseToughnessFunc), target.BaseToughnessFunc));

            Modifiers.Add(new CardTypeModifier(source, nameof(Types), ModifierMode.Override, null));
            foreach (var type in target.Types)
            {
                Modifiers.Add(new CardTypeModifier(source, nameof(Types), ModifierMode.Add, type));
            }

            Modifiers.Add(new StringModifier(source, nameof(Subtypes), null));
            if (target.Subtypes != null)
            {
                foreach (var subtype in target.Subtypes)
                {
                    Modifiers.Add(new StringModifier(source, nameof(Subtypes), ModifierMode.Add, subtype));
                }
            }

            Modifiers.Add(new StaticAbilityModifier(source, nameof(StaticAbilities), ModifierMode.Override, null));
            foreach (var staticAbility in target.StaticAbilities)
            {
                Modifiers.Add(new StaticAbilityModifier(source, nameof(StaticAbilities), ModifierMode.Add, staticAbility));
            }

            Modifiers.Add(new AbilityModifier(source, nameof(Abilities), ModifierMode.Override, null));
            foreach (var ability in target.Abilities)
            {
                Modifiers.Add(new AbilityModifier(this, nameof(Abilities), ModifierMode.Add, ability.Copy(this)));
            }
        }
Ejemplo n.º 4
0
        protected override void Validate()
        {
            if (!ComputeOnce && InitializeOnStart)
            {
                Modifiers.Add(FLKeywords.ComputeOnceKeyword);
            }

            //if (Init && !EvaluateOnce)
            //{
            //    Modifiers.Add(FLKeywords.EvaluateOnceKeyword);
            //}
        }
Ejemplo n.º 5
0
 private Event(Event eventToCopyFrom)
     : base(null)
 {
     eventToCopyFrom.CloneInto(this);
     DataType = eventToCopyFrom.DataType.Clone();
     foreach (string mod in eventToCopyFrom.Modifiers)
     {
         Modifiers.Add(mod);
     }
     AddAccessorText    = eventToCopyFrom.AddAccessorText;
     RemoveAccessorText = eventToCopyFrom.RemoveAccessorText;
     InitialValue       = eventToCopyFrom.InitialValue;
 }
Ejemplo n.º 6
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ColdSlowStatusEffect"/> class.
 /// </summary>
 public ColdSlowStatusEffect()
 {
     Modifiers.Add(
         new AttributeModifier <AttributeType>(
             AttributeType.MaximumVelocity,
             GameLogicConstants.ColdSlowMultiplier,
             AttributeComputationType.Multiplicative));
     Modifiers.Add(
         new AttributeModifier <AttributeType>(
             AttributeType.AccelerationForce,
             GameLogicConstants.ColdSlowMultiplier,
             AttributeComputationType.Multiplicative));
 }
        public Trigger()
        {
            InitializeComponent();
            DataContext = this;

            Modifiers.Add("Equal To");
            Modifiers.Add("Not Equal To");
            Modifiers.Add("Greater Than");
            Modifiers.Add("Less Than");
            Modifiers.Add("Contains");
            Modifiers.Add("Contains Match Case");
            Modifiers.Add("Contains Whole Word");
            Modifiers.Add("Contains Whole Word Match Case");
        }
Ejemplo n.º 8
0
        public void AddSlide(bool reversed, bool createEvents)
        {
            if (!HasSlide)
            {
                var slide = new GuitarSlide(this, reversed);
                slide.IsNew = true;

                Modifiers.Add(slide);

                if (createEvents)
                {
                    slide.CreateEvents();
                }
            }
        }
Ejemplo n.º 9
0
        public void AddHammeron(bool createEvents)
        {
            if (!HasHammeron)
            {
                var ho = new GuitarHammeron(this);
                Modifiers.Add(ho);

                ho.IsNew = true;

                if (createEvents)
                {
                    ho.CreateEvents();
                }
            }
        }
Ejemplo n.º 10
0
        public void AddStrum(ChordStrum strum, bool createEvents)
        {
            if (strum != ChordStrum.Normal && !HasStrum)
            {
                if (strum.HasFlag(ChordStrum.High))
                {
                    var gs = new GuitarChordStrum(this, ChordModifierType.ChordStrumHigh);

                    gs.IsNew = true;

                    Modifiers.Add(gs);

                    if (createEvents)
                    {
                        gs.CreateEvents();
                    }
                }
                if (strum.HasFlag(ChordStrum.Mid))
                {
                    var gs = new GuitarChordStrum(this, ChordModifierType.ChordStrumMed);

                    gs.IsNew = true;

                    Modifiers.Add(gs);

                    if (createEvents)
                    {
                        gs.CreateEvents();
                    }
                }
                if (strum.HasFlag(ChordStrum.Low))
                {
                    var gs = new GuitarChordStrum(this, ChordModifierType.ChordStrumLow);

                    gs.IsNew = true;

                    Modifiers.Add(gs);

                    if (createEvents)
                    {
                        gs.CreateEvents();
                    }
                }
            }
        }
        public StepRequest(VirtualMachine virtualMachine, ThreadReference thread, StepSize size, StepDepth depth)
            : base(virtualMachine)
        {
            Contract.Requires(virtualMachine != null);

            _thread = thread;
            _size   = size;
            _depth  = depth;

            ThreadId threadId = default(ThreadId);

            if (thread != null)
            {
                threadId = thread.ThreadId;
            }

            Modifiers.Add(Types.EventRequestModifier.Step(threadId, (Types.StepSize)size, (Types.StepDepth)depth));
        }
Ejemplo n.º 12
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ColdSlowStatusEffect"/> class.
 /// </summary>
 public FreezeStatusEffect()
 {
     // Disable acceleration and rotation.
     Modifiers.Add(
         new AttributeModifier <AttributeType>(
             AttributeType.AccelerationForce,
             0,
             AttributeComputationType.Multiplicative));
     Modifiers.Add(
         new AttributeModifier <AttributeType>(
             AttributeType.RotationForce,
             0,
             AttributeComputationType.Multiplicative));
     // Also disable weapons. We do this by just making it incredibly expensive to shoot ;)
     Modifiers.Add(
         new AttributeModifier <AttributeType>(
             AttributeType.WeaponEnergyConsumption,
             float.PositiveInfinity,
             AttributeComputationType.Multiplicative));
 }
Ejemplo n.º 13
0
        public MethodHeader(string data, string className = "")
        {
            var splittedByBracket = data.Split('(');
            var splitted          = splittedByBracket[0].Split(' ');
            int i = 0;

            while (i < splitted.Length)
            {
                Modifiers.Add(splitted[i]);
                ++i;
            }
            Name = Modifiers[Modifiers.Count - 1];
            Modifiers.RemoveAt(Modifiers.Count - 1);
            var tmp = Modifiers[Modifiers.Count - 1];

            if (PossibleModifiers.Contains(tmp))
            {
                Type = MethodTypes.Constructor;
            }
            else
            {
                ReturnType = tmp;
                Modifiers.RemoveAt(Modifiers.Count - 1);
            }
            splitted = splittedByBracket[1].Replace(")", "").Split(',');
            i        = 0;
            while (i < splitted.Length)
            {
                Arguments.Add(splitted[i]);
                ++i;
            }
            if (Modifiers.Contains("static"))
            {
                FullName = $"{className}.{Name}";
                Type     = MethodTypes.Static;
            }
            else
            {
                FullName = Name;
            }
        }
Ejemplo n.º 14
0
    // Use this for initialization
    void Start()
    {
        // TODO: Add a random offset so the towers wont fire in sync cause it's loud as hell.
        timer          = new TaylorTimer(60000 / speed);
        timer.Elapsed += Timer_Elapsed;

        meshRenderer = GetComponent <MeshRenderer>();
        audioSource  = GetComponent <AudioSource>();

        SetTowerPosition(gridPositionX, gridPositionY);

        visualizer = gameObject.GetComponent <BezierVisualizer>();

        if (projectileObject != null)
        {
            projectileSize = projectileObject.transform.Find("Projectile_Front").gameObject.GetComponent <MeshRenderer>().bounds.size;//projectileObject.GetComponentInChildren<MeshRenderer>().bounds.size;
        }

        SetSpawnPos();

        if (visualizeBezier)
        {
            VisualizeBezier();
        }

        height = meshRenderer.bounds.max.y;

        creatures = PlayerManager.GetCreatures(ownerID);

        if (radiusVisualizer != null)
        {
            radiusVisualizer.range = range;
        }

        rangeRounded = (int)(range + 0.5f);

        //TEST ONLY:
        Modifiers.Add(new Modifier(ModiferTypes.Fire, 1));
        Modifiers.Add(new Modifier(ModiferTypes.Ice, 1));
        Modifiers.Add(new Modifier(ModiferTypes.Acid, 1));
    }
Ejemplo n.º 15
0
        public LinqSpecification <TType> OrderByDescending <TProperty>(Expression <Func <TType, TProperty> > property)
        {
            if (property == null)
            {
                throw new ArgumentNullException(nameof(property));
            }

            var isOrderBy = Modifiers.LastOrDefault(m => m is IOrderedQueryable <TType>) != null;

            if (!isOrderBy)
            {
                IOrderedQueryable <TType> orderByQuery(IQueryable <TType> q) => q.OrderByDescending(property);

                Modifiers.Add(orderByQuery);
            }
            else
            {
                IOrderedQueryable <TType> thenByQuery(IQueryable <TType> q) => ((IOrderedQueryable <TType>)q).ThenByDescending(property);

                Modifiers.Add(thenByQuery);
            }
            return(this);
        }
        /// <summary>
        /// If the given <paramref name="asyncKeyword"/> is default, remove all async keywords, if any.
        /// Otherwise, replace the existing <see cref="AsyncKeyword"/> (the first one) or add a new one.
        /// </summary>
        private protected SyntaxTokenList UpdateAsyncKeyword(SyntaxToken asyncKeyword)
        {
            // Remove *all* async keywords if any, i.e, after this call, AsyncKeyword property should return 'default'.
            if (asyncKeyword == default)
            {
                if (Modifiers.Any(SyntaxKind.AsyncKeyword))
                {
                    return(new SyntaxTokenList(Modifiers.Where(m => !m.IsKind(SyntaxKind.AsyncKeyword))));
                }

                return(Modifiers);
            }

            // add or replace.
            var existingAsync = AsyncKeyword;

            if (existingAsync == default)
            {
                return(Modifiers.Add(asyncKeyword));
            }

            return(Modifiers.Replace(existingAsync, asyncKeyword));
        }
Ejemplo n.º 17
0
        private void MemberModifier(Modifiers m)
        {
            switch (this.la.kind)
            {
                case 0x58:
                    base.lexer.NextToken();
                    m.Add(Modifier.VBInterfaceEnums, this.t.Location);
                    return;

                case 0x5d:
                    base.lexer.NextToken();
                    m.Add(Modifier.Override, this.t.Location);
                    return;

                case 0x5f:
                    base.lexer.NextToken();
                    m.Add(Modifier.Private, this.t.Location);
                    return;

                case 0x60:
                    base.lexer.NextToken();
                    m.Add(Modifier.Protected, this.t.Location);
                    return;

                case 0x61:
                    base.lexer.NextToken();
                    m.Add(Modifier.Public, this.t.Location);
                    return;

                case 0x62:
                    base.lexer.NextToken();
                    m.Add(Modifier.ReadOnly, this.t.Location);
                    return;

                case 0x53:
                    base.lexer.NextToken();
                    m.Add(Modifier.Internal, this.t.Location);
                    return;

                case 0x30:
                    base.lexer.NextToken();
                    m.Add(Modifier.Dim, this.t.Location);
                    return;

                case 70:
                    base.lexer.NextToken();
                    m.Add(Modifier.Extern, this.t.Location);
                    return;

                case 0x66:
                    base.lexer.NextToken();
                    m.Add(Modifier.Sealed, this.t.Location);
                    return;

                case 0x6a:
                    base.lexer.NextToken();
                    m.Add(Modifier.Static, this.t.Location);
                    return;

                case 0x79:
                    base.lexer.NextToken();
                    m.Add(Modifier.Virtual, this.t.Location);
                    return;

                case 0x7b:
                    base.lexer.NextToken();
                    m.Add(Modifier.Volatile, this.t.Location);
                    return;

                case 0x76:
                    base.lexer.NextToken();
                    m.Add(Modifier.Unsafe, this.t.Location);
                    return;
            }
            base.SynErr(0x89);
        }
Ejemplo n.º 18
0
 public AbstractPovObject AddModifiers(AbstractObjectModifier modifier)
 {
     Modifiers.Add(modifier);
     return(this);
 }
Ejemplo n.º 19
0
 private void AccessorModifiers(out Modifiers m)
 {
     m = new Modifiers();
     if (this.la.kind == 0x5f)
     {
         base.lexer.NextToken();
         m.Add(Modifier.Private, this.t.Location);
     }
     else if (this.la.kind == 0x60)
     {
         base.lexer.NextToken();
         m.Add(Modifier.Protected, this.t.Location);
         if (this.la.kind == 0x53)
         {
             base.lexer.NextToken();
             m.Add(Modifier.Internal, this.t.Location);
         }
     }
     else if (this.la.kind == 0x53)
     {
         base.lexer.NextToken();
         m.Add(Modifier.Internal, this.t.Location);
         if (this.la.kind == 0x60)
         {
             base.lexer.NextToken();
             m.Add(Modifier.Protected, this.t.Location);
         }
     }
     else
     {
         base.SynErr(0x9e);
     }
 }
Ejemplo n.º 20
0
        protected override void Validate()
        {
            base.Validate();


            if (IsDynamic && IsStatic)
            {
                throw new FLInvalidFLElementModifierUseException(
                          ElementName,
                          "dynamic/static",
                          "Can not declare a function static and dynamic."
                          );
            }

            if (ElementName != FLKeywords.EntryFunctionKey && NoCall && NoJump)
            {
                throw new FLInvalidFLElementModifierUseException(
                          ElementName,
                          "nocall/nojump",
                          $"The function {ElementName} is not reachable because nocall and nojump are set."
                          );
            }

            if (InitializeOnStart && !IsStatic)
            {
                Modifiers.Add(FLKeywords.StaticElementModifier);
                if (!NoJump)
                {
                    Modifiers.Add(FLKeywords.NoJumpKeyword);
                }
            }

            //if ((EvaluateOnce || Init) && IsDynamic)
            //{
            //    throw new FLInvalidFLElementModifierUseException(ElementName, "dynamic/static", "Can not declare a function to be dynamic and evaluated once/at initialization.");
            //}

            if (!IsDynamic && !IsStatic)
            {
                //if (Init || EvaluateOnce)
                //{
                //    Modifiers.Add(FLKeywords.StaticElementModifier);
                //}
                //else
                //{
                Modifiers.Add(FLKeywords.DynamicElementModifier);

                //}
            }

            if (ComputeOnce && !IsStatic)
            {
                throw new FLInvalidFLElementModifierUseException(
                          ElementName,
                          "static/once",
                          $"The function {ElementName} can not have the modifier once unless static is set as well."
                          );
            }

            if (!NoJump && IsStatic)
            {
                Modifiers.Add(FLKeywords.NoJumpKeyword);

                //throw new FLInvalidFLElementModifierUseException(ElementName, "nojump/static", "Can not use the static modifier without adding the nojump modifier.");
            }
        }
Ejemplo n.º 21
0
        private void TypeModifier(Modifiers m)
        {
            switch (this.la.kind)
            {
                case 0x53:
                    base.lexer.NextToken();
                    m.Add(Modifier.Internal, this.t.Location);
                    return;

                case 0x58:
                    base.lexer.NextToken();
                    m.Add(Modifier.VBInterfaceEnums, this.t.Location);
                    return;

                case 1:
                    base.lexer.NextToken();
                    if (!(this.t.val == "partial"))
                    {
                        break;
                    }
                    m.Add(Modifier.Partial, this.t.Location);
                    return;

                case 0x30:
                    base.lexer.NextToken();
                    m.Add(Modifier.Dim, this.t.Location);
                    return;

                case 0x5f:
                    base.lexer.NextToken();
                    m.Add(Modifier.Private, this.t.Location);
                    return;

                case 0x60:
                    base.lexer.NextToken();
                    m.Add(Modifier.Protected, this.t.Location);
                    return;

                case 0x61:
                    base.lexer.NextToken();
                    m.Add(Modifier.Public, this.t.Location);
                    return;

                case 0x66:
                    base.lexer.NextToken();
                    m.Add(Modifier.Sealed, this.t.Location);
                    return;

                case 0x6a:
                    base.lexer.NextToken();
                    m.Add(Modifier.Static, this.t.Location);
                    return;

                case 0x76:
                    base.lexer.NextToken();
                    m.Add(Modifier.Unsafe, this.t.Location);
                    return;

                default:
                    base.SynErr(130);
                    break;
            }
        }
Ejemplo n.º 22
0
 public void AddModifier(string modifier)
 {
     Modifiers.Add(modifier);
 }
Ejemplo n.º 23
0
 void ParseModifierList(Modifiers m)
 {
     while (StartOf(4)) {
     switch (la.kind) {
     case 46: {
         Get();
         m.Add(newMod);
         break;
     }
     case 55: {
         Get();
         m.Add(publicMod);
         break;
     }
     case 54: {
         Get();
         m.Add(protectedMod);
         break;
     }
     case 41: {
         Get();
         m.Add(internalMod);
         break;
     }
     case 53: {
         Get();
         m.Add(privateMod);
         break;
     }
     case 76: {
         Get();
         m.Add(unsafeMod);
         break;
     }
     case 64: {
         Get();
         m.Add(staticMod);
         break;
     }
     case 56: {
         Get();
         m.Add(readonlyMod);
         break;
     }
     case 81: {
         Get();
         m.Add(volatileMod);
         break;
     }
     case 79: {
         Get();
         m.Add(virtualMod);
         break;
     }
     case 60: {
         Get();
         m.Add(sealedMod);
         break;
     }
     case 51: {
         Get();
         m.Add(overrideMod);
         break;
     }
     case 6: {
         Get();
         m.Add(abstractMod);
         break;
     }
     case 28: {
         Get();
         m.Add(externMod);
         break;
     }
     }
     }
 }
Ejemplo n.º 24
0
        void ParseInterfaceMemberDeclaration()
        {
            Modifiers m = new Modifiers(this);
            // every interface member is public
            m.Add(Parser.publicMod);
            TypeKind dummy;
            bool newSet = false;

            while (la.kind == 98) {
            ParseAttributes();
            }
            if (la.kind == 46) {
            Get();
            m.Add(Parser.newMod); newSet = true;
            }
            if (StartOf(11)) {
            if (la.kind == 76) {
                Get();
                m.Add(Parser.unsafeMod);
            }
            if (la.kind == 46) {
                Get();
                if (newSet) Error("duplicate operand 'new'"); m.Add(Parser.newMod);
            }
            ParseType(out dummy, true);
            if (la.kind == 1) {
                Get();
                if (la.kind == 99 || la.kind == 101) {
                    if (la.kind == 101) {
                        ParseTypeParameterList();
                    }
                    Expect(99);
                    if (StartOf(7)) {
                        ParseFormalParameterList();
                    }
                    Expect(115);
                    while (la.kind == 1) {
                        ParseTypeParameterConstraintsClause();
                    }
                    Expect(116);
                } else if (la.kind == 97) {
                    Get();
                    ParseInterfaceAccessors(m);
                    Expect(113);
                } else SynErr(148);
            } else if (la.kind == 68) {
                Get();
                Expect(98);
                ParseFormalParameterList();
                Expect(114);
                Expect(97);
                ParseInterfaceAccessors(m);
                Expect(113);
            } else SynErr(149);
            } else if (la.kind == 26) {
            Get();
            ParseType(out dummy, false);
            Expect(1);
            Expect(116);
            } else SynErr(150);
        }
Ejemplo n.º 25
0
 public void Add(string targetName, float value, SimulationModifierDescriptor.ModifierOperation operation = SimulationModifierDescriptor.ModifierOperation.Addition)
 {
     Modifiers.Add(new SingleSimulationModifierDescriptor(targetName, operation, value));
 }
Ejemplo n.º 26
0
        private void ParseFunctionParameterList(ScriptFunction func)
        {
            Modifiers modifiers;
            bool atEndOfParameterList = false;

            while ((!atEndOfParameterList) &&
                   (!_source.NextIsKeyword(PredefinedSymbol.CloseParenthesis)))
            {
                modifiers = new Modifiers();

                while (_source.PeekNextToken() is ModifierToken)
                {
                    modifiers.Add((ModifierToken)_source.ReadNextToken());
                }

                if (_source.NextIsKeyword(PredefinedSymbol.VariableArguments))
                {
                    func.VariableArguments = true;
                    _source.ExpectKeyword(PredefinedSymbol.CloseParenthesis, "Variable arguments must be the last parameter");
                    break;
                }

                Token parameterType = _source.ReadNextAsVariableType();
                Token parameterName = null;
                _source.IgnoreAsteriskIfPresent();

                CompilerUtils.VerifyModifiersAgainstType(ModifierTargets.FunctionParameter, modifiers);

                VerifyParameterTypeValidForFunction(parameterType);

                if (!_source.PeekNextToken().Defined)
                {
                    parameterName = _source.ReadNextTokenAndThrowIfAlreadyDefined();
                }
                else
                {
                    func.IsPrototypeOnly = true;
                }

                FunctionParameter parameter = new FunctionParameter(parameterType, parameterName);
                parameter.Modifiers = modifiers;

                if (_source.NextIsKeyword(PredefinedSymbol.SetEqual))
                {
                    parameter.DefaultValue = _source.ReadNextAsConstInt();
                }
                
                if (_source.NextIsKeyword(PredefinedSymbol.CloseParenthesis))
                {
                    atEndOfParameterList = true;
                }
                else
                {
                    _source.ExpectKeyword(PredefinedSymbol.Comma);
                }

                func.Parameters.Add(parameter);
            }
        }
Ejemplo n.º 27
0
 void IPlayerHelper.AddModifier(FarmerModifier modifier)
 {
     Modifiers.Add(modifier);
     UpdateCompound();
 }
Ejemplo n.º 28
0
 public Term(string value, Modifiers.Base mod)
     : this(value)
 {
     Modifiers.Add(mod);
 }
Ejemplo n.º 29
0
 public LinqSpecification <TType> AddQuery(Func <IQueryable <TType>, IQueryable <TType> > query)
 {
     Modifiers.Add(query);
     return(this);
 }
Ejemplo n.º 30
0
 public void AddClassFilter(string classPattern)
 {
     Modifiers.Add(Types.EventRequestModifier.ClassMatchFilter(classPattern));
 }
Ejemplo n.º 31
0
 public Property(string type, string name)
     : base(type, name)
 {
     Modifiers.Add("public");
 }
Ejemplo n.º 32
0
 public void Add(T modifier)
 {
     Modifiers.Add(modifier);
     onChanged();
 }
 public IModifierSet Add(IModifier modifier)
 {
     Modifiers.Add(modifier);
     return(this);
 }
Ejemplo n.º 34
0
 public void AddClassExclusionFilter(string classPattern)
 {
     Modifiers.Add(Types.EventRequestModifier.ClassExcludeFilter(classPattern));
 }
Ejemplo n.º 35
0
 public Constructor(string classname)
     : base(null, classname)
 {
     Modifiers.Add("public");
 }
Ejemplo n.º 36
0
 public Constructor(Class whichclass)
     : base(null, whichclass.Name)
 {
     Modifiers.Add("public");
 }
Ejemplo n.º 37
0
 private Modifiers ParseMods()
 {
     var mods = new Modifiers();
     while (HasCurrent)
     {
         switch (Current.type)
         {
             case PUB: case PRIV: case EXTERN: case INTERN:
                 var mod = Current;
                 Advance();
                 Spanned<string> optArg = null;
                 if (Check(STR))
                 {
                     optArg = Current.Image.Spanned(Current.span);
                     Advance();
                 }
                 mods.Add(mod, optArg);
                 break;
             default: return mods;
         }
     }
     return mods;
 }