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


C# Rope类代码示例

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


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

示例1: AttachRopeToCharacter

 private void AttachRopeToCharacter(GameObject pBalloonObject, Rope pRope, Rigidbody2D pTackBody)
 {
     pRope.GetStartOfRope().GetComponent<HingeJoint2D>().connectedBody = pTackBody;
     DistanceJoint2D balloonJoint= pBalloonObject.GetComponent<DistanceJoint2D> ();
     balloonJoint.distance = GetMaxBalloonRopeDistance (pBalloonObject);
     balloonJoint.connectedBody = pTackBody;
 }
开发者ID:ysucae,项目名称:Balloune,代码行数:7,代码来源:RopeManager.cs

示例2: AppendLongTextToEmptyRope

 public void AppendLongTextToEmptyRope()
 {
     string text = BuildLongString(1000);
     Rope<char> rope = new Rope<char>();
     rope.AddText(text);
     Assert.AreEqual(text, rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:7,代码来源:RopeTests.cs

示例3: RopeTextSource

		/// <summary>
		/// Creates a new RopeTextSource.
		/// </summary>
		public RopeTextSource(Rope<char> rope, ITextSourceVersion version)
		{
			if (rope == null)
				throw new ArgumentNullException("rope");
			this.rope = rope.Clone();
			this.version = version;
		}
开发者ID:AkshayVats,项目名称:SuperShell,代码行数:10,代码来源:RopeTextSource.cs

示例4: AttachRopeToBalloon

 private void AttachRopeToBalloon(GameObject pBalloon, Rope pRope)
 {
     HingeJoint2D balloonHinge = pBalloon.GetComponent<HingeJoint2D> ();
     balloonHinge.connectedBody = pRope.GetEndOfRope().GetComponent<Rigidbody2D>();
     balloonHinge.connectedAnchor = new Vector2 (0, pRope.GetLengthOfEachSegment());
     pRope.transform.parent = pBalloon.transform;
 }
开发者ID:ysucae,项目名称:Balloune,代码行数:7,代码来源:RopeManager.cs

示例5: InitializeRopeFromLongString

		public void InitializeRopeFromLongString()
		{
			string text = BuildLongString(1000);
			Rope<char> rope = new Rope<char>(text);
			Assert.AreEqual(text.Length, rope.Length);
			Assert.AreEqual(text, rope.ToString());
			Assert.AreEqual(text.ToCharArray(), rope.ToArray());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:RopeTests.cs

示例6: OnFireRope

        public void OnFireRope(Rope newRope)
        {
            lock (m_ropeLock)
            {
                if (m_rope != null)
                    CutRope();

                m_rope = newRope;
            }
        }
开发者ID:rkdrnf,项目名称:fortresswar,代码行数:10,代码来源:RopeController.cs

示例7: CutRope

 public void CutRope()
 {
     lock (m_ropeLock)
     {
         if (m_rope != null)
         {
             m_rope.Cut();
             m_rope = null;
         }
     }
 }
开发者ID:rkdrnf,项目名称:fortresswar,代码行数:11,代码来源:RopeController.cs

示例8: ConcatenateSmallRopesToRope

 public void ConcatenateSmallRopesToRope()
 {
     StringBuilder b = new StringBuilder();
     Rope<char> rope = new Rope<char>();
     for (int i = 1; i <= 1000; i++) {
         b.Append(i.ToString());
         b.Append(' ');
         rope.AddRange(CharRope.Create(i.ToString() + " "));
     }
     Assert.AreEqual(b.ToString(), rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:11,代码来源:RopeTests.cs

示例9: RopeFired

 public void RopeFired(Rope newRope)
 {
     lock (m_ropeLock)
     {
         if (newRope != null)
         {
             m_player.SetState(CharacterState.ROPING);
             m_player.ToAirMaterial();
         }
     }
 }
开发者ID:rkdrnf,项目名称:fortresswar,代码行数:11,代码来源:RopeController.cs

示例10: ConcatenateStringToRope

		public void ConcatenateStringToRope()
		{
			StringBuilder b = new StringBuilder();
			Rope<char> rope = new Rope<char>();
			for (int i = 1; i <= 1000; i++) {
				b.Append(i.ToString());
				rope.AddText(i.ToString());
				b.Append(' ');
				rope.Add(' ');
			}
			Assert.AreEqual(b.ToString(), rope.ToString());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:12,代码来源:RopeTests.cs

示例11: ConcatenateSmallRopesToRopeBackwards

 public void ConcatenateSmallRopesToRopeBackwards()
 {
     StringBuilder b = new StringBuilder();
     Rope<char> rope = new Rope<char>();
     for (int i = 1; i <= 1000; i++) {
         b.Append(i.ToString());
         b.Append(' ');
     }
     for (int i = 1000; i >= 1; i--) {
         rope.InsertRange(0, CharRope.Create(i.ToString() + " "));
     }
     Assert.AreEqual(b.ToString(), rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:13,代码来源:RopeTests.cs

示例12: TestToArrayAndToStringWithParts

		public void TestToArrayAndToStringWithParts()
		{
			string text = BuildLongString(1000);
			Rope<char> rope = new Rope<char>(text);
			
			string textPart = text.Substring(1200, 600);
			char[] arrayPart = textPart.ToCharArray();
			Assert.AreEqual(textPart, rope.ToString(1200, 600));
			Assert.AreEqual(arrayPart, rope.ToArray(1200, 600));
			
			Rope<char> partialRope = rope.GetRange(1200, 600);
			Assert.AreEqual(textPart, partialRope.ToString());
			Assert.AreEqual(arrayPart, partialRope.ToArray());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:14,代码来源:RopeTests.cs

示例13: TextDocument

        /// <summary>
        /// Create a new text document with the specified initial text.
        /// </summary>
        public TextDocument(IEnumerable<char> initialText)
        {
            if (initialText == null)
              throw new ArgumentNullException("initialText");
              rope = new Rope<char>(initialText);
              lineTree = new DocumentLineTree(this);
              lineManager = new LineManager(lineTree, this);
              lineTrackers.CollectionChanged += delegate {
              lineManager.UpdateListOfLineTrackers();
              };

              anchorTree = new TextAnchorTree(this);
              undoStack = new UndoStack();
              FireChangeEvents();
        }
开发者ID:joazlazer,项目名称:ModdingStudio,代码行数:18,代码来源:TextDocument.cs

示例14: ConcateRope

        public ConcateRope(Rope left, Rope right)
        {
            if (left == null) throw new ArgumentNullException("left");
            if (right == null) throw new ArgumentNullException("right");

            _depth = Math.Max(GetDepth(left), GetDepth(right)) + 1;
            if (_depth > MaxDepth) {
                throw new ArgumentException(
                    String.Format("The result tree of rope cannot be over {0} in depth.", MaxDepth));
            }

            _left = left;
            _right = right;
            _length = left.Length + right.Length;
        }
开发者ID:JeffreyZhao,项目名称:NRopes,代码行数:15,代码来源:ConcateRope.cs

示例15: ConcatenateSmallRopesByInsertionInMiddle

 public void ConcatenateSmallRopesByInsertionInMiddle()
 {
     StringBuilder b = new StringBuilder();
     Rope<char> rope = new Rope<char>();
     for (int i = 1; i <= 1000; i++) {
         b.Append(i.ToString("d3"));
         b.Append(' ');
     }
     int middle = 0;
     for (int i = 1; i <= 500; i++) {
         rope.InsertRange(middle, CharRope.Create(i.ToString("d3") + " "));
         middle += 4;
         rope.InsertRange(middle, CharRope.Create((1001-i).ToString("d3") + " "));
     }
     Assert.AreEqual(b.ToString(), rope.ToString());
 }
开发者ID:nic0lae,项目名称:filewatcher,代码行数:16,代码来源:RopeTests.cs


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