Exemple #1
0
        public async Task NewRaund()
        {
            randomCart = new RandomCard();

            clientObjects.ForEach(i => i.cartInHand = new List <string>());
            GivingCardsForUser();
        }
Exemple #2
0
    private void Awake()
    {
        //战斗场景初始设置
        playerhp          = PlayerPrefs.GetInt("hp");
        playerenegy       = 3;
        playerenegy_max   = 3;
        playerarmor       = PlayerPrefs.GetInt("armor");
        playermoney       = PlayerPrefs.GetInt("money");
        curepotioncount   = PlayerPrefs.GetInt("curepotion");
        armorpotioncount  = PlayerPrefs.GetInt("armorpotion");
        damagepotioncount = PlayerPrefs.GetInt("damagepotion");
        RandomCard        = new RandomCard();

        string bg = PlayerPrefs.GetString("bg_stage");

        bg_stage.sprite     = Resources.Load <Sprite>("Textures/" + bg);
        hp.text             = playerhp.ToString();
        bg_hp.fillAmount    = playerhp / 100f;
        enegy.text          = playerenegy.ToString();
        bg_enegy.fillAmount = playerenegy / playerenegy_max;
        money.text          = playermoney.ToString();
        curepotion.text     = curepotioncount.ToString();
        armorpotion.text    = armorpotioncount.ToString();
        damagepotion.text   = damagepotioncount.ToString();
        playername          = PlayerPrefs.GetString("playername");
        GameObject.Find("Panel").GetComponent <PanelListener>().enegy = playerenegy;
        usedcard = new List <Card>();
        DicLoadTest();
        LoadMonster();
        bg_armor.gameObject.SetActive(false);
        text_armor.gameObject.SetActive(false);
        DeathPanel.SetActive(false);
    }
Exemple #3
0
    public void Awake()
    {
        Debug.Log("Initializing a new GUIManager.");

        // Cada nuevo GUI manager destruye el anterior para facilitar la creación de modos nuevos
        instance = this;

        GoBackButton.SetActive(false);
        RandomCard.SetActive(false);
        OpenConfigMenuButton.SetActive(true);
        GeneralConfMenu.SetActive(false);
        ConfLang.SetActive(false);
        ConfTypeSentences.SetActive(false);
        ConfNivelPicante.SetActive(false);
        ConfCustomSentences.SetActive(false);
        ConfPlayers.SetActive(false);
        WarningPopup.SetActive(false);
        InfoPopup.SetActive(false);
        LinkPopup.SetActive(false);
        ConditionPopup.SetActive(false);
        ConfMiscelanea.SetActive(false);
        rateAppPopup.SetActive(false);

        Debug.Log("GUIManager initialization successful.");
    }
Exemple #4
0
 public void randomizeAllCards()
 {
     foreach (GameObject card in cards)
     {
         RandomCard randomCard = card.GetComponent <RandomCard>();
         randomCard.randomizeCards(currentPack, false);
     }
 }
Exemple #5
0
        public void MaxNumberRemovableTest()
        {
            Assert.AreEqual(0, space.MaxNumberRemovable());
            Card        c    = RandomCard.GetRandomCard();
            List <Card> temp = new List <Card>();

            temp.Add(c);
            space.Place(temp);
            Assert.AreEqual(1, space.MaxNumberRemovable());
        }
Exemple #6
0
        public void FreeSpaceIsFreeTest()
        {
            Assert.IsTrue(space.IsFree());
            Card        c    = RandomCard.GetRandomCard();
            List <Card> temp = new List <Card>();

            temp.Add(c);
            space.Place(temp);
            Assert.IsFalse(space.IsFree());
        }
Exemple #7
0
        public void GetCardTest()
        {
            TestCardStack cards = new TestCardStack();
            Card          c     = RandomCard.GetRandomCard();

            cards.CardList.Add(c);
            Card d = cards.GetCard(0);

            Assert.AreEqual(c, d);
        }
Exemple #8
0
    void OnRightClick()
    {
        RandomCard randCard     = GetComponentInChildren <RandomCard>();
        int        cardObtained = randCard.Index;

        randCard.GetComponent <Transform>().localScale = new Vector3(randCard.factor_x, randCard.factor_y, randCard.factor_z);
        CameraScript manager = GameObject.FindWithTag("Manager").GetComponent <CameraScript>();

        manager.addCard(cardObtained);
        StartCoroutine(alpha());
    }
Exemple #9
0
        public void IsPlaceableTest()
        {
            Card        c    = RandomCard.GetRandomCard();
            List <Card> temp = new List <Card>();

            temp.Add(c);
            temp.Add(c);
            Assert.IsFalse(space.IsPlaceable(temp));
            temp.Remove(c);
            Assert.IsTrue(space.IsPlaceable(temp));
            space.Place(temp);
            Assert.IsFalse(space.IsPlaceable(temp));
        }
Exemple #10
0
 // Use this for initialization
 void Start()
 {
     waitTime = 1.0f / fps;
     rotateDegreePerSecond = 1000f;
     originalRotationValue = transform.rotation;
     cw         = true;
     alphaSpeed = 0.03f;
     isReady    = false;
     manager    = GameObject.Find("_Manager").GetComponent <CameraScript>();
     rareCard   = GetComponentInChildren <RareCard>();
     randomCard = GetComponentInChildren <RandomCard>();
     rareCard.disableRare();
     ripple = GetComponentInChildren <rippleSharp>();
     ripple.disableObject();
     Gameback = GetComponentInChildren <BackCard>();
     cheat    = false;
 }
Exemple #11
0
        public void Initialize()
        {
            sourceToModify       = new TestCardStack();
            sourceToCompare      = new TestCardStack();
            destinationToModify  = new TestCardStack();
            destinationToCompare = new TestCardStack();

            for (int i = 0; i < stackSize; i++)
            {
                Card rand1 = RandomCard.GetRandomCard();
                Card rand2 = RandomCard.GetRandomCard();

                sourceToCompare.CardList.Add(rand1);
                sourceToModify.CardList.Add(rand1);
                destinationToCompare.CardList.Add(rand2);
                destinationToModify.CardList.Add(rand2);
            }
        }
Exemple #12
0
    public void LoadStoreList()
    {
        string filepath = Application.dataPath + "/Doc" + "/cardlist_all.json";

        if (File.Exists(filepath))
        {
            Debug.Log("file is real");
            StreamReader sr  = new StreamReader(filepath);               //读取JSON文件
            string       str = sr.ReadToEnd();
            licards = JsonConvert.DeserializeObject <List <Card> >(str); //反序列化为List
        }
        RandomCard randomCard = new RandomCard();

        licards = randomCard.RandomCards(licards);
        for (int i = 0; i < 8; i++)
        {
            GameObject         go      = Instantiate(newcard.gameObject, rect.content);
            StoreCardListerner setcard = go.GetComponentInChildren <StoreCardListerner>();
            setcard.Textset(licards[i]);
        }
    }
Exemple #13
0
 // Use this for initialization
 void Start()
 {
     waitTime = 1.0f / fps;
     rotateDegreePerSecond = 1000f;
     originalRotationValue = transform.rotation;
     cw = true;
     alphaSpeed = 0.03f;
     isReady = false;
     manager = GameObject.Find("_Manager").GetComponent<CameraScript>();
     rareCard = GetComponentInChildren<RareCard>();
     randomCard = GetComponentInChildren<RandomCard>();
     rareCard.disableRare();
     ripple = GetComponentInChildren<rippleSharp>();
     ripple.disableObject();
     Gameback = GetComponentInChildren<BackCard>();
     cheat = false;
 }