Beispiel #1
0
    public bool PlayCard(CardColor requestedColor, CardPicture requestedPicture)
    {
        for (int i = 0; i < this.hand.Size; i++)
        {
            Card card = this.hand[i];
            if (card.Color == requestedColor || card.Picture == requestedPicture)
            {
                this.hand.Remove(i);
                this.playing.Push(card);
                String s = String.Format(">   {0} plays {1}", this.name, card);
                MauMaster.Log(s);
                this.PrintMauMauIf();
                return(true);
            }
        }

        // 'Bube' maybe played upon every card!
        for (int i = 0; i < this.hand.Size; i++)
        {
            Card card = this.hand[i];
            if (card.Picture == CardPicture.Bube)
            {
                this.hand.Remove(i);
                this.playing.Push(card);
                String s = String.Format(">   {0} plays {1}", this.name, card);
                MauMaster.Log(s);
                this.PrintMauMauIf();
                return(true);
            }
        }

        return(false);
    }
Beispiel #2
0
    // Update is called once per frame
    public void ToggleCard(Sprite cardSprite, string name, string description, Sprite contamination, string rarity, string type)
    {
        // Populate baseball card

        // Get card preview picture
        cardPicture = gameObject.transform.Find("BaseballCard/CardPicture").GetComponent <CardPicture>();
        cardPicture.m_Image.sprite = cardSprite;

        // Get card item name
        cardTitle = gameObject.transform.Find("BaseballCard/CardTitle").GetComponent <CardTitle>();
        cardTitle.m_Title.text = name;

        // Get card item description
        cardDescription = gameObject.transform.Find("BaseballCard/CardDescription").GetComponent <CardDescription>();
        cardDescription.m_Description.text = description;

        // Get card contamination
        cardContamination = gameObject.transform.Find("BaseballCard/Contamination").GetComponent <Quality_Sprite>();
        cardContamination.m_Quality.sprite = contamination;

        // Get card rarity
        cardRarity = gameObject.transform.Find("BaseballCard/Rarity").GetComponent <Quality_Sprite>();
        cardRarity.m_Quality.sprite = Resources.Load <Sprite>(rarity);

        // Get card type
        cardType = gameObject.transform.Find("BaseballCard/Type").GetComponent <Quality_Sprite>();
        cardType.m_Quality.sprite = Resources.Load <Sprite>(type);

        // Show baseball card
        ApparateCard();
    }
Beispiel #3
0
    void Awake()
    {
        // this.player_hand_card_manager = new List<PlayerHandCardManager>();
        // this.player_hand_card_manager.Add(new PlayerHandCardManager());

        this.back_image = SpriteManager.Instance.get_card_sprite("back");

        this.sprite_renderer = GetComponent <SpriteRenderer>();
        this.engine          = new MightyEngine();

        this.card_pictures = new List <CardPicture>();
        for (int i = 0; i < 13; i++)
        {
            GameObject original = Resources.Load("cardframe") as GameObject;
            GameObject obj      = GameObject.Instantiate(original);
            obj.transform.parent = transform;
            CardPicture card_pic = obj.AddComponent <CardPicture>();
            this.card_pictures.Add(card_pic);
        }

        this.test_position = new List <Vector3>();
        make_slot_positions(test_position_root, this.test_position);
    }
 public void remove(CardPicture card_picture)
 {
     bool result = this.cards.Remove(card_picture);
 }
 public void add(CardPicture card_picture)
 {
     this.cards.Add(card_picture);
 }
Beispiel #6
0
        public Card(CardPicture cardPicture, CardColor cardColor)
        {
            Number = GetPictureNumber(cardPicture);

            Color = cardColor;
        }
Beispiel #7
0
 public static int GetPictureNumber(CardPicture color)
 {
     return(10 + (int)color);
 }
Beispiel #8
0
 // c'tor
 public Card(CardColor color, CardPicture picture)
 {
     this.color   = color;
     this.picture = picture;
 }