public static void SetAvailableResourceItemTypes(List <string> resourceItemTypes) { if (GAValidator.ValidateResourceItemTypes(resourceItemTypes.ToArray())) { GA_Wrapper.SetAvailableResourceItemTypes(GA_MiniJSON.Serialize(resourceItemTypes)); } }
// Token: 0x0600014F RID: 335 RVA: 0x0000ACC4 File Offset: 0x000090C4 public static void SetAvailableResourceItemTypes(List <string> resourceItemTypes) { if (GAValidator.ValidateResourceItemTypes(resourceItemTypes.ToArray())) { string availableResourceItemTypes = GA_MiniJSON.JsonEncode(resourceItemTypes.ToArray()); GA_Wrapper.SetAvailableResourceItemTypes(availableResourceItemTypes); } }
public void TestValidateResourceItemTypes() { // Store result bool isValid; // Valid resource types isValid = GAValidator.ValidateResourceItemTypes("gems", "gold"); Assert.True(isValid, "Valid resource types array should succeed"); // Invalid resource types isValid = GAValidator.ValidateResourceItemTypes("", "gold"); Assert.False(isValid, "Should falset allow empty resource type"); isValid = GAValidator.ValidateResourceItemTypes(); Assert.False(isValid, "Should falset allow empty array"); isValid = GAValidator.ValidateResourceItemTypes((string)null); Assert.False(isValid, "Should falset allow empty null"); isValid = GAValidator.ValidateResourceItemTypes(null, "gold"); Assert.False(isValid, "Should falset allow empty null"); }