当前位置: 首页>>代码示例>>C#>>正文


C# Sequence类代码示例

本文整理汇总了C#中Sequence的典型用法代码示例。如果您正苦于以下问题:C# Sequence类的具体用法?C# Sequence怎么用?C# Sequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Sequence类属于命名空间,在下文中一共展示了Sequence类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

    //public Seq[] sequences;
    // Use this for initialization
    void Start()
    {
        var cz = GetComponent<CombatZone>();
        var wCount = 0;
        foreach (Wav wav in waves) {
            var w = new Wave();
            cz.spawnWaves.Add(w);
            cz.spawnWaves[wCount].delayNextSeq = wav.delaySeq;
            foreach (Seq seq in wav.sequences) {

                    var sq = new Sequence ();
                    cz.spawnWaves [wCount].spawnSeqs.Add (sq);
                    sq.delayNextEvent = seq.delay;
                    sq.pos = seq.pos;
                    for (int i=0; i<seq.amount; i ++) {
                            var e = new SpawnEvent ();//sq.spawnEvents[i];
                            e.enemyType = seq.eType;
                            e.equipped = seq.equipped;
                            e.paratrooper = seq.chute;
                            Vector2 p = transform.position;
                            e.offset = p + sq.pos + (seq.offset * i);
                            sq.spawnEvents.Add (e);
                    }

            }
            wCount++;
        }
    }
开发者ID:Libeedo,项目名称:psycho-bob,代码行数:30,代码来源:CombatZoneManager.cs

示例2: buildTweener

    public override Tweener buildTweener(Sequence sequence, int frameRate)
    {
        if(go == null) return null;

        //active won't really be set, it's just a filler along with ease
        return HOTween.To(go, getTime(frameRate), new TweenParms().Prop("active", new AMPlugGOActive(setActive)).Ease(EaseType.Linear));
    }
开发者ID:nathanfunk,项目名称:MateAnimator,代码行数:7,代码来源:AMGOSetActiveKey.cs

示例3: Create

        private Sequence<InstructionNode> Create(IEnumerator<XamlInstruction> stream)
        {
            var nodes = new Sequence<InstructionNode>();

            while (IsLeading(stream.Current))
            {
                var currentNode = new InstructionNode { Leading = stream.Current };
                var continueWorking = true;
                while (stream.MoveNext() && continueWorking)
                {
                    if (IsLeading(stream.Current))
                    {
                        currentNode.Children = Create(stream);
                    }

                    var xamlNode = stream.Current;

                    if (IsTrailing(xamlNode))
                    {
                        continueWorking = false;
                        currentNode.Trailing = stream.Current;
                    }
                    else
                    {
                        currentNode.Body.Add(stream.Current);
                    }
                }

                nodes.Add(currentNode);
            }

            return nodes;
        }
开发者ID:grokys,项目名称:OmniXAML,代码行数:33,代码来源:InstructionTreeBuilder.cs

示例4: SetUp

        public void SetUp()
        {
            _gatingSequence = new Sequence(Sequencer.InitialCursorValue);

            _sequencer = new Sequencer(new SingleThreadedClaimStrategy(BufferSize), new SleepingWaitStrategy());
            _sequencer.SetGatingSequences(_gatingSequence);
        }
开发者ID:Xamarui,项目名称:Disruptor-net,代码行数:7,代码来源:SequencerTests.cs

示例5: EnemySlime

        public EnemySlime()
        {
            Sprite = Support.TiledSpriteFromFile("/Application/assets/slime_green_frames.png", 4, 4);

            IdleAnimation = new Support.AnimationAction(Sprite, 0, 8, 0.5f, looping: true);
            JumpInAnimation = new Support.AnimationAction(Sprite, 8, 12, 0.3f, looping: false);
            JumpMidAnimation = new Support.AnimationAction(Sprite, 12, 13, 1.0f, looping: false);
            JumpOutAnimation = new Support.AnimationAction(Sprite, 13, 16, 0.2f, looping: false);

            JumpAnimationSequence = new Sequence();
            JumpAnimationSequence.Add(JumpInAnimation);
            JumpAnimationSequence.Add(new CallFunc(this.Jump));
            JumpAnimationSequence.Add(JumpMidAnimation);
            JumpAnimationSequence.Add(new DelayTime() { Duration = 0.40f });
            JumpAnimationSequence.Add(JumpOutAnimation);
            JumpAnimationSequence.Add(new DelayTime() { Duration = 0.05f });
            JumpAnimationSequence.Add(IdleAnimation);

            this.AddChild(Sprite);
            Sprite.RunAction(IdleAnimation);

            //            CollisionDatas.Add(new EntityCollider.CollisionEntry() {
            //	            type = EntityCollider.CollisionEntityType.Enemy,
            //				owner = this,
            //				collider = Sprite,
            //				center = () => GetCollisionCenter(Sprite) + new Vector2(0.0f, -8.0f),
            //				radius = () => 24.0f,
            //			});
            //
            //			GroundFriction = new Vector2(0.85f);
            Health = 2.0f;
            MoveDelay = 3.0f;
        }
开发者ID:JunyaHosokawa,项目名称:PSM,代码行数:33,代码来源:EnemySlime.cs

示例6: ValidateSingleCharDnaSequence

        public void ValidateSingleCharDnaSequence()
        {
            // Gets the actual sequence and the alphabet from the Xml
            string alphabetName = this.utilityObj.xmlUtil.GetTextValue(
                Constants.SimpleDnaAlphabetNode, Constants.AlphabetNameNode);
            string actualSequence = this.utilityObj.xmlUtil.GetTextValue(
                Constants.SimpleDnaAlphabetNode, Constants.ExpectedSingleChar);

            // Logs information to the log file
            ApplicationLog.WriteLine(string.Concat(
                "Sequence BVT: Sequence is as expected."));

            Sequence createSequence = new Sequence(
                Utility.GetAlphabet(alphabetName), actualSequence);

            Assert.IsNotNull(createSequence);

            // Validate the createdSequence            
            string seqNew = new string(createSequence.Select(a => (char)a).ToArray());
            Assert.AreEqual(seqNew, actualSequence);

            ApplicationLog.WriteLine(string.Concat(
                "Sequence BVT: Sequence is as expected."));

            Assert.AreEqual(Utility.GetAlphabet(alphabetName), createSequence.Alphabet);
            ApplicationLog.WriteLine(string.Concat(
                "Sequence BVT: Sequence Alphabet is as expected."));

            ApplicationLog.WriteLine(
                "Sequence BVT: The DNA with single character Sequence is completed successfully.");
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:31,代码来源:SequenceBvtTestCases.cs

示例7: SmithWatermanProteinSeqAffineGap

        public void SmithWatermanProteinSeqAffineGap()
        {
            IPairwiseSequenceAligner sw = new SmithWatermanAligner
                {
                    SimilarityMatrix = new SimilarityMatrix(SimilarityMatrix.StandardSimilarityMatrix.Blosum62),
                    GapOpenCost = -8,
                    GapExtensionCost = -1,
                };

            ISequence sequence1 = new Sequence(Alphabets.Protein, "HEAGAWGHEE");
            ISequence sequence2 = new Sequence(Alphabets.Protein, "PAWHEAE");
            IList<IPairwiseSequenceAlignment> result = sw.Align(sequence1, sequence2);
            AlignmentHelpers.LogResult(sw, result);

            IList<IPairwiseSequenceAlignment> expectedOutput = new List<IPairwiseSequenceAlignment>();
            IPairwiseSequenceAlignment align = new PairwiseSequenceAlignment();
            PairwiseAlignedSequence alignedSeq = new PairwiseAlignedSequence
                {
                    FirstSequence = new Sequence(Alphabets.Protein, "AWGHE"),
                    SecondSequence = new Sequence(Alphabets.Protein, "AW-HE"),
                    Consensus = new Sequence(Alphabets.AmbiguousProtein, "AWGHE"),
                    Score = 20,
                    FirstOffset = 0,
                    SecondOffset = 3
                };
            align.PairwiseAlignedSequences.Add(alignedSeq);
            expectedOutput.Add(align);

            Assert.IsTrue(AlignmentHelpers.CompareAlignment(result, expectedOutput));
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:30,代码来源:AlignerTests.cs

示例8: FetchStatement

		public FetchStatement(CursorPositionToken cursorPosition, CursorName cursorName, Sequence<VariableName> destinationVariables) {
			Debug.Assert(cursorPosition != null);
			Debug.Assert(cursorName != null);
			this.cursorPosition = cursorPosition;
			this.cursorName = cursorName;
			this.destinationVariables = destinationVariables.ToList();
		}
开发者ID:avonwyss,项目名称:bsn-modulestore,代码行数:7,代码来源:FetchStatement.cs

示例9: GetCompositionOfPeptide

 /// <summary>
 /// The get composition of peptide.
 /// </summary>
 /// <param name="peptide">
 /// The peptide.
 /// </param>
 /// <returns>
 /// The <see cref="Composition"/>.
 /// </returns>
 public static Composition GetCompositionOfPeptide(string peptide)
 {
     Sequence peptideSequence = new Sequence(peptide, AminoAcidSet.GetStandardAminoAcidSet());
     var composition = peptideSequence.Composition;
     composition += Composition.H2O;
     return composition;
 }
开发者ID:PNNL-Comp-Mass-Spec,项目名称:IMS-Informed-Library,代码行数:16,代码来源:PeptideUtil.cs

示例10: Can_be_reset

 public void Can_be_reset()
 {
     var sequence = new Sequence(100);
     var value = sequence.Next;
     sequence.Reset();
     Assert.Equal(100, sequence.Next);
 }
开发者ID:rbuskov,项目名称:Conjurer,代码行数:7,代码来源:SequenceTests.cs

示例11: TableForeignKeyConstraint

		public TableForeignKeyConstraint(ConstraintName constraintName, Sequence<ColumnName> columnNames, Qualified<SchemaName, TableName> refTableName, Optional<Sequence<ColumnName>> refColumnNames, Sequence<ForeignKeyAction> keyActions): base(constraintName) {
			Debug.Assert(refTableName != null);
			this.columnNames = columnNames.ToList();
			this.refTableName = refTableName;
			this.refColumnNames = refColumnNames.ToList();
			this.keyActions = keyActions.ToList();
		}
开发者ID:avonwyss,项目名称:bsn-modulestore,代码行数:7,代码来源:TableForeignKeyConstraint.cs

示例12: ExecutableNodeFactory

        public ExecutableNodeFactory(Executable executable,Executables collection)
        {
            _collection = collection;
            _executable = (DtsContainer)executable;
            _host = _executable as TaskHost;
            _seq = _executable as Sequence;
            _foreachloop = _executable as ForEachLoop;
            _forloop = _executable as ForLoop;
            _psExecutable = PSObject.AsPSObject(_executable);

            if (null != _host)
            {
                _psExecutable.Properties.Add( new PSNoteProperty( "IsTaskHost", true ));
                _mainPipe = _host.InnerObject as MainPipe;
            }
            if (null != _mainPipe)
            {
                _psExecutable.Properties.Add(new PSNoteProperty("IsDataFlow", true));
            }
            if (null != _seq)
            {
                _psExecutable.Properties.Add(new PSNoteProperty("IsSequence", true));
            }
            if (null != _foreachloop)
            {
                _psExecutable.Properties.Add(new PSNoteProperty("IsForEachLoop", true));
            }
            if (null != _forloop)
            {
                _psExecutable.Properties.Add(new PSNoteProperty("IsForLoop", true));
            }
        }
开发者ID:beefarino,项目名称:bips,代码行数:32,代码来源:ExecutableNodeFactory.cs

示例13: OnJellyfishDrain

 void OnJellyfishDrain()
 {
     pulse = DOTween.Sequence().Pause().SetLoops(loopCount);
     pulse.Append(image.DOColor(toColor, intervalOn).SetEase(easeOn));
     pulse.Append(image.DOColor(Color.black, intervalOff).SetEase(easeOff));
     pulse.Play();
 }
开发者ID:TheWanderingTree,项目名称:temple,代码行数:7,代码来源:Pulse_BatteryDrain.cs

示例14: TestMUMmerAlignerMultipleMum

        public void TestMUMmerAlignerMultipleMum()
        {
            string reference = "ATGCGCATCCCCTT";
            string search = "GCGCCCCCTA";

            Sequence referenceSeq = null;
            Sequence searchSeq = null;

            referenceSeq = new Sequence(Alphabets.DNA, reference);
            searchSeq = new Sequence(Alphabets.DNA, search);

            List<ISequence> searchSeqs = new List<ISequence>();
            searchSeqs.Add(searchSeq);

            MUMmerAligner mummer = new MUMmerAligner();
            mummer.LengthOfMUM = 4;
            mummer.PairWiseAlgorithm = new NeedlemanWunschAligner();

            IList<IPairwiseSequenceAlignment> result = mummer.AlignSimple(referenceSeq, searchSeqs);

            // Check if output is not null
            Assert.AreNotEqual(null, result);
            IList<IPairwiseSequenceAlignment> expectedOutput = new List<IPairwiseSequenceAlignment>();
            IPairwiseSequenceAlignment align = new PairwiseSequenceAlignment();
            PairwiseAlignedSequence alignedSeq = new PairwiseAlignedSequence();
            alignedSeq.FirstSequence = new Sequence(Alphabets.DNA, "ATGCGCATCCCCTT");
            alignedSeq.SecondSequence = new Sequence(Alphabets.DNA, "--GCGC--CCCCTA");
            alignedSeq.Consensus = new Sequence(AmbiguousDnaAlphabet.Instance, "ATGCGCATCCCCTW");
            alignedSeq.Score = -11;
            alignedSeq.FirstOffset = 0;
            alignedSeq.SecondOffset = 2;
            align.PairwiseAlignedSequences.Add(alignedSeq);
            expectedOutput.Add(align);
            Assert.IsTrue(CompareAlignment(result, expectedOutput));
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:35,代码来源:MUMmerAlignerTests.cs

示例15: FillAlignedSequencesWithDifferentCountTest

        public void FillAlignedSequencesWithDifferentCountTest()
        {
            // AACGCTAG
            // ATCCTAG
            var sequence1 =
                new Sequence(
                    new[]
                        {
                            Nucleotide.A, Nucleotide.A, Nucleotide.C, Nucleotide.G, Nucleotide.C, Nucleotide.T,
                            Nucleotide.A, Nucleotide.G
                        },
                    1);
            var sequence2 =
                new Sequence(
                    new[]
                        {
                            Nucleotide.A, Nucleotide.T, Nucleotide.C, Nucleotide.C, Nucleotide.T, Nucleotide.A,
                            Nucleotide.G
                        },
                    2);

            var estimator = new OperationDistanceEstimator(4, 2, 0, 1);
            var multipleAlignment1 = new MultipleAlignment(1, new[] { sequence1 }, estimator);
            var multipleAlignment2 = new MultipleAlignment(2, new[] { sequence2 }, estimator);
            var newMultipleAlignment = new MultipleAlignment(3, multipleAlignment1, multipleAlignment2);
            var algorithm = new MultipleAlignmentAlgorithm(estimator);
            var groupAlgorithm = new GroupAlignmentAlgorithm(estimator);
            algorithm.FillAlignedSequences(newMultipleAlignment, groupAlgorithm.GeneratePairAlignmentsMap(newMultipleAlignment));
        }
开发者ID:Cabyrc,项目名称:GroupAlignment,代码行数:29,代码来源:MultipleAlignmentAlgorithmTests.cs


注:本文中的Sequence类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。