Ejemplo n.º 1
0
        void InitDirSkipList(string rootDirectoryPath, string directoryConfigFilePath)
        {
            DirectorySkipList = new HashSet <string>();

            string volume  = rootDirectoryPath.Substring(0, @"X:".Length);
            var    dirList = ConfigFileUtil.LoadConfigFile(directoryConfigFilePath);

            foreach (ConfigSettings settings in dirList)
            {
                if (settings.Category == ignoreCategory)
                {
                    string newSkipPath = settings.Value;
                    Match  match       = Regex.Match(newSkipPath, @"^[a-zA-Z]:");
                    if (match.Success)
                    {
                        newSkipPath = newSkipPath.Remove(0, volume.Length);
                    }
                    newSkipPath = volume + newSkipPath;

                    if (newSkipPath.Length >= rootDirectoryPath.Length)
                    {
                        DirectorySkipList.Add(newSkipPath.ToLower());
                    }
                }
                else if ((settings.Category == settingsCategory) && (settings.Key == excludeHiddenSystemKey))
                {
                    excludeHiddenSystemFilesDirs = !(settings.Value.ToLower() == "false");
                }
            }
        }
Ejemplo n.º 2
0
 void Start()
 {
     if (ConfigFileUtil.GetValue("mode") == 2)
     {
         float randomPos = (Random.Range(0, 2) == 0) ? 5.5f : -5.5f;
         transform.position = new Vector2(transform.position.x, randomPos);
     }
 }
Ejemplo n.º 3
0
        void InitFileSkipList(string rootDirectoryPath, string extensionConfigFilePath)
        {
            ExtensionSkipList = new HashSet <string>();

            var extList = ConfigFileUtil.LoadConfigFile(extensionConfigFilePath);

            foreach (ConfigSettings settings in extList)
            {
                if (settings.Category == extensionsIgnoreCategory)
                {
                    ExtensionSkipList.Add(settings.Value.ToLower());
                }
            }
        }
Ejemplo n.º 4
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         if (ConfigFileUtil.GetValue("mode") == 1)
         {
             collision.GetComponent <Player>().SetInvincibleState(true);
         }
         else
         {
             MakeBothPlayersInvincible(collision);
         }
         Destroy(gameObject);
     }
 }
Ejemplo n.º 5
0
    private static void LoadCategoryMap()
    {
        FileExtensionToCategoryMap = new Dictionary <string, string>();
        HashSet <string> Categories = new HashSet <string>();

        ConfigSettings[] extensionList = ConfigFileUtil.LoadConfigFile(ConfigFiles.GetCategoriesFile());

        foreach (ConfigSettings settings in extensionList)
        {
            FileExtensionToCategoryMap.Add(settings.Value.ToLower(), settings.Category);
            Categories.Add(settings.Category);
        }

        Console.WriteLine("   Loaded {0} file extensions in {1} categories\n", FileExtensionToCategoryMap.Count, Categories.Count);
    }
Ejemplo n.º 6
0
        //private static string EnumerateGeoSensePlusFolderFiles()
        //{
        //    StringBuilder sb = new StringBuilder();
        //    string[] filePaths = Directory.GetFiles(ConfigFileUtil.GetConfigDirPath());
        //    foreach (var file in filePaths)
        //        sb.AppendLine(file);
        //    return sb.ToString();
        //}

        public string GetInfo()
        {
            var    name           = System.Reflection.Assembly.GetEntryAssembly().GetName();
            string osDescription  = RuntimeInformation.OSDescription;
            string osArchitecture = RuntimeInformation.OSArchitecture.ToString();

            string prod;

#if DEBUG
            prod = "Development";
#else
            prod = "Production";
#endif

            StringBuilder sb = new StringBuilder();
            sb.AppendLine($"Version: {name.Name} {name.Version}, {prod}");
            sb.AppendLine($"System: {osDescription}, {osArchitecture}");
            sb.AppendLine($"Configuration File: {ConfigFileUtil.GetConfigFile()}");
            //sb.AppendLine("Read GeoSensePlus directory:");
            //sb.AppendLine(EnumerateGeoSensePlusFolderFiles());

            return(sb.ToString());
        }
Ejemplo n.º 7
0
 void Start()
 {
     ConfigFileUtil.UpdateMode(FindObjectsOfType <GameObject>().Where(o => o.GetComponent <Player>() != null).Count());
 }
Ejemplo n.º 8
0
    public dynamic GetKeysForPlayerId(int id)
    {
        string mode = ConfigFileUtil.GetValue("mode").ToString();

        return(ConfigFileUtil.GetValue(mode)[id]);
    }
Ejemplo n.º 9
0
 public (float, float) GetPositionRangeBasedOnPlayMode()
 {
     // Ignores the values set from the outside when we have 2 players
     return(ConfigFileUtil.GetValue("mode").ToString() == "2" ? (0, 0) : (RandomPostionRangeStart, RandomPostionRangeEnd));
 }