Exemplo n.º 1
0
        public void ToStringTest()
        {
            var mapSize = new MapSize(1, 1);

            var toString = mapSize.ToString();

            Assert.AreEqual($"{mapSize.Width}x{mapSize.Height}", toString);
        }
Exemplo n.º 2
0
        public void Describe(Description description)
        {
            description.ShortDescription = "Lightning Queues Configuration";

            description.Properties[nameof(DefaultPort)]  = DefaultPort.ToString();
            description.Properties[nameof(MaxDatabases)] = MaxDatabases.ToString();
            description.Properties[nameof(MapSize)]      = MapSize.ToString();
        }
Exemplo n.º 3
0
        public static int[] MapSizeToInts(MapSize mapSize)
        {
            int[]    res       = new int[2];
            char[]   splitters = { '_', 'x' };
            string[] strings   = mapSize.ToString().Split(splitters);
            int.TryParse(strings[1], out res[0]);
            int.TryParse(strings[2], out res[1]);

            return(res);
        }
Exemplo n.º 4
0
        public string GetField(int field)
        {
            switch (field)
            {
            case 0: return(HostName);

            case 1: return(GameName);

            case 2: return(GameVersion);

            case 3: return(MapName);

            case 4: return(GameType);

            case 5: return(GameVariant);

            case 6: return(NumPlayers.ToString());

            case 7: return(MaxPlayers.ToString());

            case 8: return(GameMode);

            case 9: return((Password ? 1 : 0).ToString());

            case 10: return(TimeLimit.ToString());

            case 11: return(RoundTime.ToString());

            case 12: return(HostPort.ToString());

            case 13: return((Dedicated ? 1 : 0).ToString());

            case 14: return((Ranked ? 1 : 0).ToString());

            case 15: return((AntiCheat ? 1 : 0).ToString());

            case 16: return(OS);

            case 17: return((BattleRecorder ? 1 : 0).ToString());

            case 18: return(BRIndex);

            case 19: return(BRDownload);

            case 20: return((Voip ? 1 : 0).ToString());

            case 21: return((AutoBalance ? 1 : 0).ToString());

            case 22: return((FriendlyFire ? 1 : 0).ToString());

            case 23: return(TKMode);

            case 24: return(StartDelay.ToString());

            case 25: return(SpawnTime.ToString("0.000000", CultureInfo.InvariantCulture));

            case 26: return(ServerText);

            case 27: return(ServerLogo);

            case 28: return(CommunityWebsite);

            case 29: return(ScoreLimit.ToString());

            case 30: return(TicketRatio.ToString());

            case 31: return(TeamRatio.ToString("0.000000", CultureInfo.InvariantCulture));

            case 32: return(Team1Name);

            case 33: return(Team2Name);

            case 34: return((CoopEnabled ? 1 : 0).ToString());

            case 35: return((Pure ? 1 : 0).ToString());

            case 36: return(MapSize.ToString());

            case 37: return((Unlocks ? 1 : 0).ToString());

            case 38: return(Fps.ToString());

            case 39: return((Plasma ? 1 : 0).ToString());

            case 40: return(ReservedSlots.ToString());

            case 41: return(CoopBotRatio.ToString());

            case 42: return(CoopBotCount.ToString());

            case 43: return(CoopBotDifficulty.ToString());

            case 44: return((NoVehicles ? 1 : 0).ToString());

            default:
                return("");
            }
        }
Exemplo n.º 5
0
 public static string MapSizeToString(MapSize size)
 {
     return(size.ToString().Split('_')[1]);
 }
Exemplo n.º 6
0
        public static void CreateTempMapFiles(MapSize SizeToCreate, string strNameOfMap, Homm5RMG.Properties.Settings settings, int [] SelectedFactions, int[][] ExcludedPlayersFactions)
        {
            DeleteTempMapFiles();
            strMapName = strNameOfMap;

            string strTargetTemp = MAPS_INITIAL_DIR + strMapName;

            Directory.CreateDirectory(strTargetTemp);
            DirectoryInfo dirinfEmptyMapFiles = new DirectoryInfo(Assembly.GetExecutingAssembly().CodeBase.Substring(0, Assembly.GetExecutingAssembly().CodeBase.Length - 12).Substring(8) + "Data\\Basic Empty Map Files\\" + SizeToCreate.ToString());

            CopyToTarget(dirinfEmptyMapFiles, "", strTargetTemp);

            SetMapName();
            SetMapParameters(settings, SelectedFactions, ExcludedPlayersFactions);
        }