示例#1
0
        private void SetSquare(FloorProperties tile, ColorEnum color)
        {
            switch (color)
            {
            case ColorEnum.Green:
                tile.GetComponent <Renderer>().material = greenPlacementMaterial;
                _greenGameObject = tile.gameObject;
                _isGreenActive   = true;

                if (tile.color == ColorEnum.Red)
                {
                    _isRedActive = false;
                }
                break;

            case ColorEnum.Red:
                tile.GetComponent <Renderer>().material = redPlacementMaterial;
                _redGameObject = tile.gameObject;
                _isRedActive   = true;

                if (tile.color == ColorEnum.Green)
                {
                    _isGreenActive = false;
                }
                break;
            }

            tile.color = color;
        }
示例#2
0
        /// <summary>
        /// Convert ColorEnum to ConsoleColor color.
        /// </summary>
        /// <param name="color"></param>
        /// <returns>ConsoleColor</returns>
        public static ConsoleColor MatchColor(ColorEnum color)
        {
            ConsoleColor matchColor;

            switch (color)
            {
                case ColorEnum.Blue:
                    matchColor = ConsoleColor.Blue;
                    break;
                case ColorEnum.Green:
                    matchColor = ConsoleColor.Green;
                    break;
                case ColorEnum.Red:
                    matchColor = ConsoleColor.Red;
                    break;
                case ColorEnum.Yellow:
                    matchColor = ConsoleColor.Yellow;
                    break;
                default:
                    matchColor = ConsoleColor.White;
                    break;
            }

            return matchColor;
        }
        public void leaves_name_alone()
        {
            var otherType = new ColorEnum();

            otherType.Name.ShouldBe("ColorsEnum");
            otherType.Values.Count().ShouldBe(5);
        }
 public Boolean tryToPutAtMediumCircle(ColorEnum color)
 {
     for (int i = 2; i < 6; i++)
     {
         if (isValidToPutChess(i, 1, color))
         {
             putChess(i, 1, color);
             return(true);
         }
         else if (isValidToPutChess(i, 6, color))
         {
             putChess(i, 6, color);
             return(true);
         }
         else if (isValidToPutChess(1, i, color))
         {
             putChess(1, i, color);
             return(true);
         }
         else if (isValidToPutChess(6, i, color))
         {
             putChess(6, i, color);
             return(true);
         }
     }
     return(false);
 }
示例#5
0
        ///Events

        /*
         * Starts a new game of chess, resets the board and variables
         */
        private void Reset(object sender, EventArgs e)
        {
            PlayerColor        = ColorEnum.White;
            aPlayerHasWon      = false;
            lblPlayerTurn.Text = PlayerColor.ToString() + "'s Turn";
            lblWinText.Text    = "";

            //Create a basic game of chess
            gameBoard.createNewBoard();

            ColorEnum color = ColorEnum.Black;

            for (int i = 0; i < 2; i++)
            {
                gameBoard.addPiece(new Rook(color, new Location(0, i * 7 - 0)));
                gameBoard.addPiece(new Knight(color, new Location(1, i * 7 - 0)));
                gameBoard.addPiece(new Bishop(color, new Location(2, i * 7 - 0)));
                gameBoard.addPiece(new King(color, new Location(3, i * 7 - 0)));
                gameBoard.addPiece(new Queen(color, new Location(4, i * 7 - 0)));
                gameBoard.addPiece(new Bishop(color, new Location(5, i * 7 - 0)));
                gameBoard.addPiece(new Knight(color, new Location(6, i * 7 - 0)));
                gameBoard.addPiece(new Rook(color, new Location(7, i * 7 - 0)));
                for (int j = 0; j < 8; j++)
                {
                    gameBoard.addPiece(new Pawn(color, new Location(j, Math.Abs(i * 7 - 1))));
                }

                color = ColorEnum.White;
            }
            gameBoard.RefreshPieceImage();
        }
示例#6
0
        public void CloneTarget(PlayModeInfo target)
        {
            // this.gameId = target.gameId;
            // this.location = target.location;
            // this.showIndex = target.showIndex;  这三个不需要拷贝

            this.bg           = target.bg;
            this.btnImg       = target.btnImg;
            this.cardTheame   = target.cardTheame;
            this.coinName     = target.coinName;
            this.color        = target.color;
            this.createName   = target.createName;
            this.gameName     = target.gameName;
            this.hallName     = target.hallName;
            this.img          = target.img;
            this.isOnline     = target.isOnline;
            this.isOpen       = target.isOpen;
            this.isOpenUrl    = target.isOpenUrl;
            this.name         = target.name;
            this.openUrl      = target.openUrl;
            this.package      = target.package;
            this.playTypeName = target.playTypeName;
            this.tag          = target.tag;
            this.tips         = target.tips;
            this.goldRoomName = target.goldRoomName;
            this.wanfaType    = target.wanfaType;
            this.isOpenGold   = target.isOpenGold;
            this.headIcon     = target.headIcon;
        }
示例#7
0
            // This method paints a graphical representation of the
            // selected value of the LightShpae property.
            public override void PaintValue(PaintValueEventArgs e)
            {
                ColorEnum shape = (ColorEnum)e.Value;
                Brush     b     = Brushes.Violet;
                Pen       p     = Pens.Violet;
                {
                    switch (shape)
                    {
                    case ColorEnum.Zielony:
                        b = Brushes.Green;
                        p = Pens.Green;
                        break;

                    case ColorEnum.Czerwony:
                        b = Brushes.Red;
                        p = Pens.Red;
                        break;

                    case ColorEnum.Niebieski:
                        b = Brushes.Blue;
                        p = Pens.Blue;
                        break;
                    }
                    e.Graphics.DrawRectangle(p, e.Bounds);
                    //e.Graphics.FillRectangle(b, e.Bounds);
                    p.Dispose();
                    b.Dispose();
                }
            }
示例#8
0
 internal RedBlackTreeNode(TKey key, TValue value, ColorEnum color, int hashedKey)
 {
     Value     = value;
     HashedKey = hashedKey;
     Color     = color;
     Key       = key;
 }
示例#9
0
 public Card(string pic, ColorEnum color, CardInscription active, bool mark)
 {
     Picture = pic;
     Color   = color;
     Active  = active;
     Mark    = mark;
 }
示例#10
0
    private void SetAnswerID(ColorEnum randomColor)
    {
        for (int i = 0; i < AnswerInfos.Count; i++)
        {
            ColorEnum color = ColorEnum.Blue;
            switch (AnswerInfos[i].SpriteID)
            {
            case SpriteID.Balloon_Red:
                AnswerInfos[i].AnswerID = AnswerID.Balloon_Red;
                color = ColorEnum.Red;
                break;

            case SpriteID.Balloon_Blue:
                AnswerInfos[i].AnswerID = AnswerID.Balloon_Blue;
                color = ColorEnum.Blue;
                break;

            case SpriteID.Balloon_Green:
                AnswerInfos[i].AnswerID = AnswerID.Balloon_Green;
                color = ColorEnum.Green;
                break;

            case SpriteID.Balloon_Yellow:
                AnswerInfos[i].AnswerID = AnswerID.Balloon_Yellow;
                color = ColorEnum.Yellow;
                break;
            }
            if (color == randomColor)
            {
                CurrentColorID = AnswerInfos[i].AnswerID;
            }
        }
    }
示例#11
0
        public Piece CreatePiece(PieceEnum type, ColorEnum color)
        {
            switch (type)
            {
            case PieceEnum.RightQueen:
                return(new Queen(color, type));

            case PieceEnum.LeftQueen:
                return(new Queen(color, type));

            case PieceEnum.RightKing:
                return(new King(color, type));

            case PieceEnum.LeftKing:
                return(new King(color, type));

            case PieceEnum.Rook:
                return(new Rook(color, type));

            case PieceEnum.Knight:
                return(new Knight(color, type));

            case PieceEnum.Bishop:
                return(new Bishop(color, type));

            case PieceEnum.Pawn:
                return(new Pawn(color, type));

            default:
                throw new Exception("Unsupported piece type.");
            }
        }
示例#12
0
 public GradientDefaultAttribute(ColorEnum startColor, ColorEnum endColor, float startAlpha = 1f, float endAlpha = 1f)
 {
     this.startColor   = GetColor(startColor);
     this.endColor     = GetColor(endColor);
     this.startColor.a = startAlpha;
     this.endColor.a   = endAlpha;
 }
示例#13
0
    /// <summary>
    /// Sets answerInfo according to supplied color. If color is the random color, this sets the answerID to the supplied answerInfo AnswerID
    /// </summary>
    /// <param name="answerInfo">Answer info.</param>
    /// <param name="color">Color.</param>
    /// <param name="randomColor">Random color.</param>
    private void SetAnswer(ref SpeedTouchAnswerInfo answerInfo, ColorEnum color, ColorEnum randomColor)
    {
        switch (color)
        {
        case ColorEnum.Red:
            answerInfo.SpriteID = SpriteID.Balloon_Red;
            answerInfo.AnswerID = AnswerID.Balloon_Red;
            break;

        case ColorEnum.Blue:
            answerInfo.SpriteID = SpriteID.Balloon_Blue;
            answerInfo.AnswerID = AnswerID.Balloon_Blue;
            break;

        case ColorEnum.Yellow:
            answerInfo.SpriteID = SpriteID.Balloon_Yellow;
            answerInfo.AnswerID = AnswerID.Balloon_Yellow;
            break;

        case ColorEnum.Green:
            answerInfo.SpriteID = SpriteID.Balloon_Green;
            answerInfo.AnswerID = AnswerID.Balloon_Green;
            break;
        }

        if (color == randomColor)
        {
            CurrentColorID = answerInfo.AnswerID;
        }
    }
示例#14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private List <Cloth> searchByText()
        {
            string words = string.IsNullOrEmpty(txtSearchInput.Text) ? null : txtSearchInput.Text;

            ColorEnum colors = ColorEnum.NONE;

            foreach (ColorItem ci in colorItems)
            {
                if (ci.Selected)
                {
                    colors |= ci.Value;
                }
            }

            ShapeEnum shapes = ShapeEnum.NONE;

            foreach (ShapeItem si in shapeItems)
            {
                if (si.Selected)
                {
                    shapes |= si.Value;
                }
            }

            return(clothSearchService.SearchByText(words, colors, shapes));
        }
示例#15
0
    private void highlightSelectedColor(ColorEnum colorEnum)
    {
        int childIdx = (int)colorEnum;

        for (int i = 0; i < this.transform.childCount; i++)
        {
            Transform child = this.transform.GetChild(i);

            Image image = child.GetComponent <Image>();
            Text  text  = child.GetChild(0).GetComponent <Text>();

            Color newImageColor = image.color;
            Color newTextColor  = text.color;

            // Change opacity of image and text based on if this is the selected child
            if (i == childIdx)
            {
                newImageColor.a = enabledOpacity;
                newTextColor    = Color.black;
                newTextColor.a  = 1.0f;
            }
            else
            {
                newImageColor.a = disabledOpacity;
                newTextColor    = Color.white;
                newTextColor.a  = disabledOpacity;
            }

            image.color = newImageColor;
            text.color  = newTextColor;
        }
    }
示例#16
0
        public static string ToExplicitString(ColorEnum color)
        {
            switch (color)
            {
            case ColorEnum.RED:
                return("RED");

            case ColorEnum.BROWN:
                return("BROWN");

            case ColorEnum.BLUE:
                return("BLUE");

            case ColorEnum.GREEN:
                return("GREEN");

            case ColorEnum.ORANGE:
                return("ORANGE");

            case ColorEnum.PINK:
                return("PINK");

            case ColorEnum.NO_COLOR:
                return("NO_COLOR");

            default:
                return("NO_COLOR");
            }
        }
示例#17
0
        /// <summary>
        /// Set stanndart position of figure by color (top)
        /// </summary>
        /// <param name="color">color flag</param>
        /// <returns>list of figures</returns>
        private List <Figure> GetStandartFiguresPositionsTop(ColorEnum color)
        {
            var figures = new List <Figure>();

            //pawns
            for (int i = 0, j = 1; i < 8; i++)
            {
                figures.Add(new Pawn(new Point(j, i), color));
            }
            //rooks
            figures.Add(new Rook(new Point(0, 0), color));
            figures.Add(new Rook(new Point(0, 7), color));
            //horses
            figures.Add(new Horse(new Point(0, 1), color));
            figures.Add(new Horse(new Point(0, 6), color));
            //bishops
            figures.Add(new Bishop(new Point(0, 2), color));
            figures.Add(new Bishop(new Point(0, 5), color));

            //king and queen
            if (color == ColorEnum.White)
            {
                figures.Add(new King(new Point(0, 3), color));
                figures.Add(new Queen(new Point(0, 4), color));
            }
            else
            {
                figures.Add(new King(new Point(0, 4), color));
                figures.Add(new Queen(new Point(0, 3), color));
            }

            return(figures);
        }
示例#18
0
        public static Color32 GetColor(ColorEnum color)
        {
            switch (color)
            {
            case ColorEnum.RED:
                return(new Color32(192, 0, 0, 255));

            case ColorEnum.BROWN:
                return(new Color32(96, 66, 42, 255));

            case ColorEnum.BLUE:
                return(new Color32(68, 114, 196, 255));

            case ColorEnum.GREEN:
                return(new Color32(112, 173, 71, 255));

            case ColorEnum.ORANGE:
                return(new Color32(237, 125, 49, 255));

            case ColorEnum.PINK:
                return(new Color32(255, 102, 255, 255));

            default:
                return(new Color32(255, 255, 255, 255));
            }
        }
        /// <summary>
        /// Add a solid color background to the variable it is applied to.
        /// </summary>
        /// <param name="color">Color.</param>
        public BackgroundAttribute(ColorEnum color)
        {
            this.color = ColorEx.GetColorByEnum(color);

            // Always display last to make sure it is applied to the variable, not another DecoratorDrawer
            order = int.MaxValue;
        }
示例#20
0
 public Card(string pic, ColorEnum color, CardInscription inscription, bool mark)
 {
     Picture     = pic;
     Color       = color;
     Inscription = inscription;
     Mark        = mark;
 }
示例#21
0
        const ColorEnum Violet = ColorEnum.Red | ColorEnum.Blue;    // 0000_1000 OR 0001_0000 = 0001_1000 = 24

        /// <summary>
        /// Fornisce una descrizione dell'enum ColorEnum.
        /// </summary>
        /// <param name="color">ColorEnum enum</param>
        /// <returns>string nome del colore</returns>
        public static string GetName(ColorEnum color)
        {
            switch (color)
            {
            case ColorEnum.Black: return("Nero");

            case ColorEnum.White: return("Bianco");

            case ColorEnum.Yellow: return("Giallo");

            case ColorEnum.Red: return("Rosso");

            case ColorEnum.Blue: return("Blu");

            case Orange: return("Arancione");

            case Green: return("Verde");

            case Violet: return("Viola");

            case (ColorEnum)22: return("Verde chiaro");

            case ColorEnum.None:
            default: return("Colore sconosciuto!");
            }
        }
示例#22
0
 public Boolean tryToPutAtInnerCircle(ColorEnum color)
 {
     for (int i = 2; i < 6; i++)
     {
         if (isValidToPutChess(i, 2, color))
         {
             putChess(i, 2, color);
             return(true);
         }
         else if (isValidToPutChess(i, 5, color))
         {
             putChess(i, 5, color);
             return(true);
         }
         else if (isValidToPutChess(2, i, color))
         {
             putChess(2, i, color);
             return(true);
         }
         else if (isValidToPutChess(5, i, color))
         {
             putChess(5, i, color);
             return(true);
         }
     }
     return(false);
 }
示例#23
0
        void ResetBlock(GameObject selectedSquare, ColorEnum color)
        {
            if (selectedSquare == null)
            {
                return;
            }

            FloorProperties square = selectedSquare.GetComponent <FloorProperties>();

            if (square == null)
            {
                return;
            }

            square.color     = ColorEnum.None;
            square.cubeColor = ColorEnum.None;
            square.cube      = null;
            selectedSquare.GetComponent <Renderer> ().material      = normalPlacementMaterial;
            square.indicator.GetComponent <MeshRenderer> ().enabled = false;
            selectedSquare = null;

            //switch statement so that more colors can be added
            switch (color)
            {
            case ColorEnum.Green:
                _isGreenActive = false;
                break;

            case ColorEnum.Red:
                _isRedActive = false;
                break;
            }
        }
示例#24
0
        public Boolean tryToPutAtBoarder(ColorEnum color)
        {
            for (int i = 2; i < 6; i++)
            {
                if (isValidToPutChess(i, 0, color))
                {
                    putChess(i, 0, color);
                    return(true);
                }
                else if (isValidToPutChess(0, i, color))
                {
                    putChess(0, i, color);
                    return(true);
                }
                else if (isValidToPutChess(7, i, color))
                {
                    putChess(7, i, color);
                    return(true);
                }
                else if (isValidToPutChess(i, 7, color))
                {
                    putChess(i, 7, color);
                    return(true);
                }
            }

            return(false);
        }
示例#25
0
文件: Tree.cs 项目: andreeapurta/Sah
        public void AddChildren(AiNode node, ColorEnum color)
        {
            List <Move> AllMoves = new List <Move>();

            foreach (var piece in node.CurrentContext.Layout)
            {
                if (piece.Value.Color == color)
                {
                    foreach (var destination in piece.Value.GetNextLegalMoves(piece.Key, node.CurrentContext))
                    {
                        if (AllMoves.Count < 10) //prea multe posibilitati si dureaza foarte mult, asa ca reduc la 10 de mutari
                        {
                            AllMoves.Add(new Move(piece.Key, destination, piece.Value));
                        }
                        else
                        {
                            break;
                        }
                    }
                }
            }
            foreach (var move in AllMoves)
            {
                AiNode child = new AiNode();
                child.CurrentContext = node.CurrentContext.Clone();
                child.CurrentContext.Update(move);
                child.Move   = move;
                child.Parent = node;
                child.Value  = CalculateValue(child.CurrentContext.Layout, child.Move);
                node.AddChild(child);
            }
        }
示例#26
0
 public HighlightAttribute(ColorEnum color = ColorEnum.YELLOW, string validateMethod = null,
                           object value    = null)
 {
     this.color          = color;
     this.validateMethod = validateMethod;
     this.value          = value;
 }
示例#27
0
    public void SetChannel(int inputColor)
    {
        ColorEnum newColor = (ColorEnum)inputColor;

        CUR_CHANNEL = newColor;
        switch (newColor)
        {
        case ColorEnum.Blue:
            x_value.PULL_ENUM = GameEnum.BlueX;
            y_value.PULL_ENUM = GameEnum.BlueY;
            break;

        case ColorEnum.Yellow:
            x_value.PULL_ENUM = GameEnum.YellowX;
            y_value.PULL_ENUM = GameEnum.YellowY;
            break;

        case ColorEnum.Red:
            x_value.PULL_ENUM = GameEnum.RedX;
            y_value.PULL_ENUM = GameEnum.RedY;
            break;

        default:
            throw new System.Exception("Error, somehow inputted a color channel we don't support.");
        }
    }
示例#28
0
 public void updateBoardArray(int i, int j, ColorEnum color)
 {
     if (i >= 0 && i < 8 && j >= 0 && j < 8)
     {
         board[i, j] = color;
     }
 }
示例#29
0
        // Метод, который выводит на экран строку заданным цветом
        public static void Print(string stroka, int color)
        {
            // Создание и инициализация переменной перечислимого типа значеним целочисленного типа, предварительно приведенным к перечислимому типу

            ColorEnum col = (ColorEnum)color;

            switch (col)
            {
            case ColorEnum.Green:
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine(stroka);
                break;

            case ColorEnum.Red:
                Console.ForegroundColor = ConsoleColor.Red;
                Console.Write(stroka);
                break;

            case ColorEnum.Blue:
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.Write(stroka);
                break;

            default:
                throw new Exception("НЕОБХОДИМО ВЫБРАТЬ ОДИН ИЗ ПРЕДЛОЖЕННЫХ ВАРИАНТОВ ЦВЕТОВ !!");
            }
        }
示例#30
0
        public void Term_DrawString(string str, PointF pos, ColorEnum bgcolor = ColorEnum.White, ColorEnum color = ColorEnum.Black)
        {
            string back = ANSI.BackWhite;
            string fore = ANSI.Black;

            if (color == ColorEnum.Red)
            {
                fore = ANSI.Red;
            }

            if (bgcolor == ColorEnum.Red)
            {
                back = ANSI.BackRed;
            }

            if (bgcolor == ColorEnum.Black)
            {
                back = ANSI.BackBlack;
            }

            Writer.Write(back);
            Writer.Write(fore);
            Writer.Write(str);
            Writer.Write(ANSI.Reset);
            Writer.Flush();
        }
示例#31
0
 public void Term_Fill(int len, ColorEnum color)
 {
     for (int i = 0; i < len; i++)
     {
         Term_DrawString(" ", new PointF(0, 0), color);
     }
 }
示例#32
0
	public bool ContainsColor(ColorEnum _color){
		if ( ( (int)color & (int)_color )==0 ){
			return false;
		}
		else{
			return true;
		}
	}
示例#33
0
	public bool GetReleaseColor(out ColorEnum _color){
		_color=color;
		if (color!=ColorEnum.White){
			UpdateColor();	
			// CameraController.Instance().ColorTo(GetColor());
			return true;
		}
		
		return false;
	}
示例#34
0
	public bool AbsorbColor(ColorEnum _color){
		if ( ( (int)color & (int)_color )==0 ){
			int finalCol=(int)color+(int)_color;
			color=(ColorEnum)finalCol;
			finalCol=Mathf.Max(finalCol,0);
			UpdateColor();	
			CameraController.Instance().ColorTo(GetColor());
			return true;
		}
		return false;
	}
示例#35
0
	public void RemoveColor(ColorEnum _color){
		if ( ((int)color & (int)_color )!=0){
			int finalCol=(int)color-(int)_color;
			finalCol=Mathf.Max(finalCol,0);
			color=(ColorEnum)finalCol;

			UpdateColor();	
			CameraController.Instance().ColorTo(GetColor());
		}
		
		
	}
示例#36
0
	public void SwtichColor(){
		int finalCol=(int)color;
		GameManager gm=GameManager.Instance();
		if (finalCol<gm.colors.Length-1){
			finalCol++;
		}
		else{
			finalCol=1;	
		}

		color=(ColorEnum)finalCol;
		SetColor(gm.GetColor(color));

		gm.player.UpdateColor();
	}
示例#37
0
 private static Color GetColor( ColorEnum color, Color baseColor, int x )
 {
     Color newColor = Color.FromArgb( baseColor.R, baseColor.G, baseColor.B );
     switch ( color )
     {
         case ColorEnum.Blue:
             newColor = Color.FromArgb( baseColor.R, baseColor.G, ( byte )x );
             //newColor.Blue = ( byte )x;
             break;
         case ColorEnum.Red:
             newColor = Color.FromArgb( ( byte )x, baseColor.G, baseColor.B );
             //newColor.Red = ( byte )x;
             break;
         case ColorEnum.Green:
             newColor = Color.FromArgb( baseColor.R, ( byte )x, baseColor.B );
             //newColor.Green = ( byte )x;
             break;
     }
     return newColor;
 }
示例#38
0
        public static List<Color> Interpolate( ColorEnum color, ChangeEnum change, Color baseColor, int step )
        {
            List<Color> colors = new List<Color>();

            if ( change == ChangeEnum.Higher )
            {
                for ( int x = 0 ; x < 255 ; x += step )
                {
                    colors.Add( GetColor( color, baseColor, x ) );
                }
            }
            else
            {
                for ( int x = 255 ; x > 0 ; x -= step )
                {
                    colors.Add( GetColor( color, baseColor, x ) );
                }
            }

            return colors;
        }
 public Color GetColorFromEnum(ColorEnum color)
 {
     switch (color)
     {
         case ColorEnum.BackgroundColor:
             return BackgroundColor;
         case ColorEnum.DarkBackgroundColor:
             return DarkBackgroundColor;
         case ColorEnum.FlashOverride:
             return FlashOverride;
         case ColorEnum.Flash:
             return Flash;
         case ColorEnum.Immediate:
             return Immediate;
         case ColorEnum.Priority:
             return Priority;
         case ColorEnum.Routine:
             return Routine;
         case ColorEnum.Black:
             return Black;
         case ColorEnum.White:
             return White;
         case ColorEnum.Node:
             return Node;
         case ColorEnum.Sink:
             return Sink;
         case ColorEnum.Collision:
             return Collision;
         case ColorEnum.Busy:
             return Busy;
         case ColorEnum.Transparent:
             return Color.Transparent;
         default:
             return Color.Transparent;
     }
 }
示例#40
0
 public void endColor()
 {
     this.document.Append(this.colorEnum.stop);
     this.colorEnum = null;
 }
示例#41
0
        readonly char poppedBallooneChar = ' '; //white color with char '.'     or      empty string :?

        #endregion Fields

        #region Constructors

        /// <summary>Initializes a new instance of the <see cref="Balloon"/> class.
        /// </summary>
        /// <param name="color">The balloon color.</param>
        public Balloon(ColorEnum color)
        {
            this.Color = color;
            this.IsPopped = false;
        }
示例#42
0
	public Color GetColor(ColorEnum _colorEnum){
		return colors[(int)_colorEnum];
	}
示例#43
0
文件: Color.cs 项目: tgiphil/GoTraxx
 /// <summary>
 /// Initializes a new instance of the <see cref="Color"/> class.
 /// </summary>
 /// <param name="color">Color</param>
 private Color(ColorEnum color)
 {
     mColor = color;
 }
 public void TheColorsAre(ColorEnum Color)
 {
     _colors.Add(new ColoredThing { Color = Color });
 }
 /// <summary>
 /// use enum to initial, eg. new Color(ColorEnum.green)
 /// </summary>
 /// <param name="colorEnum"></param>
 public ObjectColor(ColorEnum colorEnum)
 {
     this.colorEnum = colorEnum;
 }
        public IGraphicalReport GenerateDirectionReport(ColorEnum color)
        {
            foreach (PEQTableEntryRouting route in _tableRouting)
            {
                if (route._Valid) // take first valid route
                {
                    int node_dist = (int)_location.Distance(route._nextHopCheat);
                    int dist = -250;
                    if (node_dist/2 < 250)
                        dist = -node_dist/2;
                    LineReport dirReport = new LineReport(_eventManager.CurrentClock,
                        (XYDoubleLocation)_location,
                        (XYDoubleLocation)route._nextHopCheat, 0, dist, true, -_id.GetID());

                    dirReport.Color = color;
                    dirReport.IsArrow = true;

                    return dirReport;
                }
            }
            return null;
        }
示例#47
0
 public Vehicle(ColorEnum vehicleColor)
 {
     Color = vehicleColor;
 }
示例#48
0
        public void startColor(string colorName)
        {
            Util.Assert(this.colorEnum == null);
            switch (colorName)
            {
                case Presentation.RED:
                    this.colorEnum = Red;
                    break;
                case Presentation.GREEN:
                    this.colorEnum = Green;
                    break;
                default:
                    this.colorEnum = Ordinary;
                    break;
            }

            this.document.Append(this.colorEnum.start);
        }
示例#49
0
 public static ColorEnum join(ColorEnum a, ColorEnum b)
 {
     return new ColorEnum(a.start + b.start, b.stop + a.stop);
 }