Example #1
0
 public static bool TryParse(string c, out DevCommand command)
 {
     Match m = REGEX.Match(c);
     if(m.Success) {
         command = new DevCommandCapital(RegexHelper.ExtractInt(m));
         return true;
     }
     command = null;
     return false;
 }
Example #2
0
        public static bool TryParse(string c, out DevCommand command)
        {
            Match m = REGEX.Match(c);

            if (m.Success)
            {
                command = new DevCommandStopMotion();
                return(true);
            }
            command = null;
            return(false);
        }
Example #3
0
        public static bool TryParse(string c, out DevCommand command)
        {
            Match m = REGEX.Match(c);

            if (m.Success)
            {
                command = new DevCommandCapital(RegexHelper.ExtractInt(m));
                return(true);
            }
            command = null;
            return(false);
        }
Example #4
0
        public static bool TryParse(string c, out DevCommand command)
        {
            Match m = REGEX.Match(c);

            if (m.Success)
            {
                string cwd = Directory.GetCurrentDirectory();
                command = new DevCommandSave(RegexHelper.ExtractFile(m, cwd));
                return(true);
            }
            command = null;
            return(false);
        }
Example #5
0
        public static bool TryParse(string c, out DevCommand command)
        {
            Match m;

            if ((m = REGEX1.Match(c)).Success)
            {
                command = new DevCommandFOW(FogOfWar.Active);
                return(true);
            }
            if ((m = REGEX2.Match(c)).Success)
            {
                command = new DevCommandFOW(FogOfWar.Nothing);
                return(true);
            }
            command = null;
            return(false);
        }
Example #6
0
        public static bool TryParse(string c, out DevCommand command)
        {
            Match m = REGEX.Match(c);

            if (m.Success)
            {
                string[]        split = Regex.Split(m.Groups[1].Value, RegexHelper.NUM_SPLIT);
                DevCommandSpawn comm  = new DevCommandSpawn();
                comm.TeamIndex = int.Parse(split[0]);
                comm.UnitIndex = int.Parse(split[1]);
                comm.Count     = int.Parse(split[2]);
                comm.X         = float.Parse(split[3]);
                comm.Z         = float.Parse(split[4]);
                command        = comm;
                return(true);
            }
            command = null;
            return(false);
        }
Example #7
0
 public static bool TryParse(string c, out DevCommand command)
 {
     Match m = REGEX.Match(c);
     if(m.Success) {
         command = new DevCommandStopMotion();
         return true;
     }
     command = null;
     return false;
 }
Example #8
0
 public static bool TryParse(string c, out DevCommand command)
 {
     Match m = REGEX.Match(c);
     if(m.Success) {
         string[] split = Regex.Split(m.Groups[1].Value, RegexHelper.NUM_SPLIT);
         DevCommandSpawn comm = new DevCommandSpawn();
         comm.TeamIndex = int.Parse(split[0]);
         comm.UnitIndex = int.Parse(split[1]);
         comm.Count = int.Parse(split[2]);
         comm.X = float.Parse(split[3]);
         comm.Z = float.Parse(split[4]);
         command = comm;
         return true;
     }
     command = null;
     return false;
 }
Example #9
0
 public static bool TryParse(string c, out DevCommand command)
 {
     Match m = REGEX.Match(c);
     if(m.Success) {
         string cwd = Directory.GetCurrentDirectory();
         command = new DevCommandSave(RegexHelper.ExtractFile(m, cwd));
         return true;
     }
     command = null;
     return false;
 }
Example #10
0
 public static bool TryParse(string c, out DevCommand command)
 {
     Match m;
     if((m = REGEX1.Match(c)).Success) {
         command = new DevCommandFOW(FogOfWar.Active);
         return true;
     }
     if((m = REGEX2.Match(c)).Success) {
         command = new DevCommandFOW(FogOfWar.Nothing);
         return true;
     }
     command = null;
     return false;
 }