Beispiel #1
0
 public async Task Release(EnvironmentType environment)
 {
     await Task.Run(() =>
     {
         if (environmentDic.TryGetValue(environment.ToString(), out var env))
         {
             environmentDic.Remove(environment.ToString());
             Destroy(env);
         }
     }
                    );
 }
Beispiel #2
0
        public static async Task <bool> CompileAsync(EnvironmentType environment)
        {
            var configFile = $"tsconfig.{environment.ToString()}.json";

            await CreateConfigAsync(environment, configFile);

            var command = GetCommand(configFile);

            var result = await Cmd.ExecuteAsync(command);

            Console.WriteLine(result);

            File.Delete(configFile);

            var existError = result.IndexOf("error") > -1;

            if (existError)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Beispiel #3
0
        public static void SetInstallType(string product, System.Version version, EnvironmentType type)
        {
            // Write the type into the registry.

            using (RegistryKey key = GetRegistryKey(product, version))
            {
                key.SetValue(Constants.Registry.InstallTypeValueName, type.ToString());
            }
        }
Beispiel #4
0
        public async Task <GameObject> Load(EnvironmentType environment)
        {
            var env = await GameEntry.Resource.LoadAsync <GameObject>("Environments/" + environment.ToString());

            var instance = Instantiate(env, parent);

            environmentDic.Add(environment.ToString(), instance);
            LoadEnvironmentComplete?.Raise(this, instance);
            return(instance);
        }
 public string GetEnvironmentBasedValue(string property, EnvironmentType env)
 {
     try
     {
         return this.OfType<EnvironmentDependentValue>().Single(cs => cs.Property == property && cs.Environment == env).Value;
     }
     catch (Exception e)
     {
         throw new ConfigurationErrorsException(String.Format("Unable to get configuration property '{0}' from environment based variable for {1} platform", property, env.ToString()), e);
     }
 }
Beispiel #6
0
 private void RemoveEnvironmentToMainEnvironmentCode(EnvironmentType p_environmentType)
 {
     if (p_environmentType != EnvironmentType.Development &&
         p_environmentType != EnvironmentType.Production &&
         p_environmentType != EnvironmentType.Test)
     {
         List <string> __listCustomEnvironmentNames = GetListCustomEnvironmentNames();
         __listCustomEnvironmentNames.Remove(p_environmentType.ToString());
         _currentEnvironmentSelected = EnvironmentType.Development;
         SaveSupportedEnviromentsCode(__listCustomEnvironmentNames);
     }
 }
Beispiel #7
0
        public string GetFileNamePattern(EnvironmentType env)
        {
            switch (env)
            {
            case EnvironmentType.Development:
                return("dev");

            case EnvironmentType.Uat:
                return("uat");

            case EnvironmentType.Production:
                return("prod");

            default:
                throw new NotImplementedException($"Unknown environment type {env.ToString()}");
            }
        }
Beispiel #8
0
    void OnGUI()
    {
        GUILayout.Label("Map Settings", EditorStyles.boldLabel);
        width           = EditorGUILayout.IntSlider("Map Width", width, 4, 32);
        height          = EditorGUILayout.IntSlider("Map Height", height, 4, 32);
        environmentType = (EnvironmentType)EditorGUILayout.EnumPopup("Environment Type", environmentType);
        saveFolder      = EditorGUILayout.TextField("Save Folder", saveFolder);
        mapName         = EditorGUILayout.TextField("Map Name", mapName);

        if (GUILayout.Button("Load"))
        {
            Debug.Log("Loading a map");
            MapData.LoadMap(mapName, saveFolder);

            string map = "";
            for (int y = 0; y < MapData.tempMap.GetLength(1); y++)
            {
                for (int x = 0; x < MapData.tempMap.GetLength(0); x++)
                {
                    map += MapData.tempMap[x, y] + " ";
                }
                map += "\n";
            }

            Debug.Log(map);
            Debug.Log("Map Loaded!");
            EditorWindow.GetWindow(typeof(MapEditor));
            Close();
        }

        if (GUILayout.Button("Create"))
        {
            Debug.Log("Create a map");
            MapData.NewMap(width, height, Resources.Load <Texture2D>("Editor/" + environmentType.ToString()), mapName, saveFolder);

            EditorWindow.GetWindow(typeof(MapEditor));
            Close();
        }
    }
        void Buttons()
        {
            if (GUILayout.Button(EnvironmentType.None.ToString()))
            {
                selectedType = EnvironmentType.None;
            }
            foreach (EnvironmentType type in level.EnvironmentDataBase.environments.Keys)
            {
                if (GUILayout.Button(type.ToString()))
                {
                    selectedType = type;
                }
            }

            if (selectedType == EnvironmentType.None)
            {
                selectedEnvironment = new Environment();
            }
            else
            {
                selectedEnvironment = level.EnvironmentDataBase.environments[selectedType];
            }

            EditorGUILayout.LabelField("Current Brush Selected : " + selectedType.ToString());

            string message = levelSaved ? "Level was saved !" : "Save your modifications";

            if (GUILayout.Button("Save Level"))
            {
                level.map  = environmentMap;
                levelSaved = true;

                EditorUtility.SetDirty(level);
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
            }
            EditorGUILayout.LabelField(message);
        }
Beispiel #10
0
 public EnvironmentBindings[] GetEnvironmentContext(EnvironmentType environmentType)
 {
     return(environmentDic[environmentType.ToString()].GetComponentsInChildren <EnvironmentBindings>());
 }
Beispiel #11
0
 public Environment(EnvironmentType type)
 {
     this.Name = type.ToString();
 }
Beispiel #12
0
        private static void CheckEnvironment(Object[] attributes)
        {
            TestEnvironment = GetCurrentEnvironment();

            if (attributes.Length > 0 && !attributes.Contains(new ExecutionEnvironment(TestEnvironment)))
            {
                Assert.Inconclusive("This test is not designed to be executed in the '" + TestEnvironment.ToString() + "' environment.");
            }
        }
 public static IWebHostBuilder UseEnvironment(this IWebHostBuilder builder, EnvironmentType environmentType)
 {
     return(builder.UseEnvironment(environmentType.ToString()));
 }
Beispiel #14
0
 public bool TryGetEnvironmentBasedValue(string property, EnvironmentType env, out string value)
 {
     try
     {
         var dependentValue = this.OfType<EnvironmentDependentValue>().FirstOrDefault(cs => cs.Property == property && cs.Environment == env);
         if (dependentValue != null)
         {
             value = dependentValue.Value;
             return true;
         }
         else
         {
             value = null;
             return false;
         }
     }
     catch (Exception e)
     {
         throw new ConfigurationErrorsException(String.Format("Unable to get configuration property '{0}' from environment based variable for {1} platform", property, env.ToString()), e);
     }
 }
Beispiel #15
0
        public static mg_jr_Environment CreateEnvironment(EnvironmentType _environmentType, EnvironmentVariant _variant, mg_jr_ScrollingSpeed _scrolling)
        {
            mg_JetpackReboot  active             = MinigameManager.GetActive <mg_JetpackReboot>();
            GameObject        gameObject         = new GameObject("mg_jr_environment_" + _environmentType.ToString().ToLowerInvariant());
            mg_jr_Environment mg_jr_Environment2 = gameObject.AddComponent <mg_jr_Environment>();

            mg_jr_Environment2.Type        = _environmentType;
            mg_jr_Environment2.Variant     = _variant;
            mg_jr_Environment2.m_scrolling = _scrolling;
            foreach (EnvironmentLayer value in Enum.GetValues(typeof(EnvironmentLayer)))
            {
                if (value != EnvironmentLayer.MAX)
                {
                    mg_jr_ParallaxLayer instancedParallaxLayer = active.Resources.GetInstancedParallaxLayer(_environmentType, _variant, value);
                    instancedParallaxLayer.Init(active.GameLogic.TurboPlayArea);
                    Assert.NotNull(instancedParallaxLayer, "There should be a parallaxlayer for every environment and layer combination");
                    mg_jr_Environment2.SetLayer(value, instancedParallaxLayer);
                }
            }
            return(mg_jr_Environment2);
        }
Beispiel #16
0
        private EnvironmentTestData GetEnvDataFromFile(string file)
        {
            var templateEd = new EnvironmentTestData();

            try
            {
                var templateData = GetTestDataConfiguration <TestData>(file);
                templateEd = templateData != null?templateData.Data.FirstOrDefault(a => a.EnvironmentName.ToString().Equals(_environment.ToString(), StringComparison.OrdinalIgnoreCase)) : new EnvironmentTestData();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                //throw;
            }

            return(templateEd ?? new EnvironmentTestData());
        }
Beispiel #17
0
 public override string GetName()
 {
     return(Type.ToString());
 }
 public override string ToString()
 {
     return(m_environmentType.ToString() + "_" + m_difficulty);
 }
Beispiel #19
0
    public string GetEnvironmentStats()
    {
        string output = string.Format("Type: {0}\nHuman Pop: {1}\nFlora Pop: {2}\nFauna Pop: {3}\nHealth Status: {4}", type.ToString(),
                                      humanPopulation, floraPopulation, faunaPopulation, status.ToString());

        return(output);
    }
	void OnValidate() {
		if(type != lasttype){
			this.name = type.ToString();
			lasttype = type;
		}
	}