Exemplo n.º 1
0
 public static void SetAvailableResourceCurrencies(List <string> resourceCurrencies)
 {
     if (GAValidator.ValidateResourceCurrencies(resourceCurrencies.ToArray()))
     {
         GA_Wrapper.SetAvailableResourceCurrencies(GA_MiniJSON.Serialize(resourceCurrencies));
     }
 }
Exemplo n.º 2
0
 // Token: 0x0600014E RID: 334 RVA: 0x0000AC94 File Offset: 0x00009094
 public static void SetAvailableResourceCurrencies(List <string> resourceCurrencies)
 {
     if (GAValidator.ValidateResourceCurrencies(resourceCurrencies.ToArray()))
     {
         string availableResourceCurrencies = GA_MiniJSON.JsonEncode(resourceCurrencies.ToArray());
         GA_Wrapper.SetAvailableResourceCurrencies(availableResourceCurrencies);
     }
 }
Exemplo n.º 3
0
        public void TestValidateResourceCurrencies()
        {
            // Store result
            bool isValid;

            // Valid resource types
            isValid = GAValidator.ValidateResourceCurrencies("gems", "gold");
            Assert.True(isValid, "Valid resource types array should succeed");

            // Invalid resource types
            isValid = GAValidator.ValidateResourceCurrencies("", "gold");
            Assert.False(isValid, "Should false to allow empty resource type");

            isValid = GAValidator.ValidateResourceCurrencies();
            Assert.False(isValid, "Should false to allow empty array");

            isValid = GAValidator.ValidateResourceCurrencies((string)null);
            Assert.False(isValid, "Should false to allow null");

            isValid = GAValidator.ValidateResourceCurrencies(null, "gold");
            Assert.False(isValid, "Should false to allow null");
        }