예제 #1
0
파일: Card.cs 프로젝트: miguelromeral/Virus
        /// <summary>
        /// Description of the card.
        /// </summary>
        /// <returns>String with the card inf</returns>
        public override string ToString()
        {
            string value = "{0} {1}";

            switch (Color)
            {
            case CardColor.Purple:
                value = String.Format(value, ToStringShort(), Face);
                break;

            case CardColor.Wildcard:
                value = String.Format(value, ToStringShortColor(), Face.ToString());
                break;

            case CardColor.Red:
            case CardColor.Yellow:
            case CardColor.Blue:
            case CardColor.Green:
            case CardColor.Bionic:
                // Normal format.
                value = String.Format(value,
                                      Color.ToString(),
                                      Face.ToString());
                break;
            }

            return(value);
        }
예제 #2
0
    public static Card GetRandomCard(CardColor cardColor)
    {
        int i;
        int start, end;

        start = (int)(CardName)Enum.Parse(typeof(CardName), cardColor.ToString() + "Start");
        end   = (int)(CardName)Enum.Parse(typeof(CardName), cardColor.ToString() + "End");

        i = UnityEngine.Random.Range(start + 1, end);

        Card card = Card.NewCard((CardName)i);

        return(card);
    }
예제 #3
0
    /// <summary>
    /// Display the last move played on the board.
    /// </summary>
    /// <param name="move">The last move.</param>
    public void SetLastMove(AIManager.Choice move)
    {
        string    cardName  = "Discard";
        CardColor cardColor = CardColor.white;

        string[] symbols      = null;
        int[]    symbolsValue = null;
        if (move.Action == AIManager.Action.BUILD_CITY)
        {
            cardName     = move.CardToPlay.Name;
            cardColor    = this.GetCardColor(move.CardToPlay);
            symbols      = this.GetSymbolNames(move.CardToPlay);
            symbolsValue = this.GetSymbolsValue(move.CardToPlay);
        }
        else if (move.Action == AIManager.Action.BUILD_WONDER)
        {
            cardName = "Wonder";
            Step builtStep = this.Player.WonderManager.GetPreviousStep();
            if (builtStep != null)
            {
                symbols      = this.GetSymbolNames(builtStep);
                symbolsValue = this.GetSymbolsValue(builtStep);
            }
        }
        this.PlayerBoard.SetLastMove(cardName, cardColor.ToString(), symbols, symbolsValue);
    }
예제 #4
0
    // 対戦記録のロード
    public void LoadBattleData()
    {
        if (File.Exists(_filePath))
        {
            StreamReader streamReader = new StreamReader(_filePath);
            string       data         = streamReader.ReadToEnd();
            streamReader.Close();

            _cardPlayOrder.Clear();
            string[] dataArray = JsonUtility.FromJson <string>(data).Split(',');

            for (int num = 0; num < dataArray.Length; num++)
            {
                CardColor color  = (CardColor)Enum.Parse(typeof(CardColor), dataArray[num]);
                int       number = int.Parse(dataArray[num + 1]);
                Team      team   = (Team)Enum.Parse(typeof(Team), dataArray[num + 2]);

                CardData cardData = new CardData(color, number, team);

                _cardPlayOrder.Add(cardData);

                Debug.Log(color.ToString());
                Debug.Log(number);
                Debug.Log(team);
            }
        }
    }
예제 #5
0
    public void ChangeColor()
    {
        CardColor FakeColorToChange = CardColor.Blue;

        if (EventSystem.current.IsPointerOverGameObject() && EventSystem.current.currentSelectedGameObject != null && EventSystem.current.currentSelectedGameObject.GetComponent <Button>() != null)
        {
            Button clickedButton = EventSystem.current.currentSelectedGameObject.GetComponent <Button>();
            if (clickedButton.name == "RED")
            {
                FakeColorToChange = CardColor.Red;
            }
            else if (clickedButton.name == "GREEN")
            {
                FakeColorToChange = CardColor.Green;
            }
            else if (clickedButton.name == "BLUE")
            {
                FakeColorToChange = CardColor.Blue;
            }
            else if (clickedButton.name == "YELLOW")
            {
                FakeColorToChange = CardColor.Yellow;
            }

            print(FakeColorToChange.ToString());
        }
    }
        public string PrintCard()
        {
            string c = CardColor.ToString();
            string s = CardSuit.ToString();
            string v = CardValue.ToString();

            return(c + " " + v + " of " + s);
        }
예제 #7
0
        public static ConsoleColor ToConsoleColor(this CardColor value)
        {
            switch (value)
            {
            case CardColor.Red: return(ConsoleColor.Red);

            case CardColor.Black: return(ConsoleColor.Black);
            }
            throw new NotImplementedException(value.ToString());
        }
예제 #8
0
 public override string ToString()
 {
     if (type == CardType.Locomotive)
     {
         return("Locomotive");
     }
     else
     {
         return(color.ToString() + " " + type.ToString());
     }
 }
예제 #9
0
    public void UpdateCardColor(int staminaReduction)
    {
        string colorChange = cardType.ToString() + (curStamina - staminaReduction).ToString();

        curStamina -= staminaReduction;
        gameObject.GetComponent <Button>().interactable = true;
        if (curStamina == 0)
        {
            this.gameObject.GetComponent <Button>().interactable = false;
        }
        if (cardType == CardColor.red)
        {
            switch (colorChange)
            {
            case "red2":
                cardImage.color = ColorManager.red2;
                break;

            case "red1":
                cardImage.color = ColorManager.red1;
                break;

            case "red0":
                cardImage.color = ColorManager.red0;
                break;

            default:
                break;
            }
        }
        else if (cardType == CardColor.blue)
        {
            switch (colorChange)
            {
            case "blue2":
                cardImage.color = ColorManager.blue2;
                break;

            case "blue1":
                cardImage.color = ColorManager.blue1;
                break;

            case "blue0":
                cardImage.color = ColorManager.blue0;
                break;

            default:
                break;
            }
        }
        else if (cardType == CardColor.green)
        {
            switch (colorChange)
            {
            case "green2":
                cardImage.color = ColorManager.green2;
                break;

            case "green1":
                cardImage.color = ColorManager.green1;
                break;

            case "green0":
                cardImage.color = ColorManager.green0;
                break;

            default:
                break;
            }
        }
        else if (cardType == CardColor.yellow)
        {
            switch (colorChange)
            {
            case "yellow2":
                cardImage.color = ColorManager.yellow2;
                break;

            case "yellow1":
                cardImage.color = ColorManager.yellow1;
                break;

            case "yellow0":
                cardImage.color = ColorManager.yellow0;
                break;

            default:
                break;
            }
        }
    }
예제 #10
0
 public static char ToSymbol(this CardColor cardColor)
 {
     return(cardColor.ToString()[0]);
 }
예제 #11
0
 public Card GetCard(CardColor color, CardFill fill, CardShape shape)
 {
     return(GetCard(color.ToString(), fill.ToString(), shape.ToString()));
 }
예제 #12
0
파일: Card.cs 프로젝트: DouglasHeriot/Uno
 /// <summary>
 /// Get the letter representing the color
 /// </summary>
 /// <param name="cardColor"></param>
 /// <returns></returns>
 public static string CardColorToString(CardColor cardColor)
 {
     return cardColor.ToString().Substring(0,1).ToLowerInvariant();
 }
예제 #13
0
        public override string ToString()
        {
            string result = from.ToString() + " - " + to.ToString() + " s barvou " + color.ToString() + " a délkou " + length.ToString();

            return(result);
        }
예제 #14
0
 public override string ToString()
 {
     return($"{Color.ToString()[0]}{Rank}");
 }
예제 #15
0
파일: MainForm.cs 프로젝트: Isti115/SetBot
 public override string ToString()
 {
     return(((int)count).ToString() + color.ToString()[0] + type.ToString()[0] + fill.ToString()[0]);
 }
예제 #16
0
 /// <summary>
 /// Get the letter representing the color
 /// </summary>
 /// <param name="cardColor"></param>
 /// <returns></returns>
 public static string CardColorToString(CardColor cardColor)
 {
     return(cardColor.ToString().Substring(0, 1).ToLowerInvariant());
 }
예제 #17
0
 public static string ToFullPlayString(this CardColor color)
 {
     return(color.ToString().ToUpperInvariant());
 }
예제 #18
0
 public override string GetExtraInfo()
 {
     return(CardColor.ToString());
 }