⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 redblacknode.cs

📁 game implemented java
💻 CS
字号:
///<summary>
/// The RedBlackNode class encapsulates a node in the tree
/// 
/// File adapted by an implementation by "RoyClem" available at The Code Project
/// http://www.thecodeproject.com/csharp/RedBlackCS.asp
///(Comments his)
///</summary>

using System;
using System.Text;
using WindowsApplication2;

namespace RedBlackCS
{
	public class RedBlackNode
	{
        // tree node colors
		public static int	RED		= 0;
		public static int	BLACK	= 1;

		// the data or value associated with the key
		private AStarNode objData;
		// color - used to balance the tree
		private int intColor;
		// left node 
		private RedBlackNode rbnLeft;
		// right node 
		private RedBlackNode rbnRight;
        // parent node 
        private RedBlackNode rbnParent;
		private double minLeft, minRight;

		public double Left_Min
		{
			get {return minLeft;}
			set {minLeft = value;}
		}
		public double Right_Min
		{
			get {return minRight;}
			set {minRight = value;}
		}
		///<summary>
		///Data
		///</summary>
		public AStarNode Data
		{
			get
			{
				return objData;
			}
			
			set
			{
				objData = value;
			}
		}
		///<summary>
		///Color
		///</summary>
		public int Color
		{
			get
            {
				return intColor;
			}
			
			set
			{
				intColor = value;
			}
		}
		///<summary>
		///Left
		///</summary>
		public RedBlackNode Left
		{
			get
            {
				return rbnLeft;
			}
			
			set
			{
				rbnLeft = value;
			}
		}
		///<summary>
		/// Right
		///</summary>
		public RedBlackNode Right
		{
			get
            {
				return rbnRight;
			}
			
			set
			{
				rbnRight = value;
			}
		}
        public RedBlackNode Parent
        {
            get
            {
                return rbnParent;
            }
			
            set
            {
                rbnParent = value;
            }
        }

		public RedBlackNode()
		{
			Color = RED;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -