Esempio n. 1
0
        public MobileUnit(string strName, string strValue, int txOrigin,
                          int tyOrigin) : base(strName, strValue, txOrigin, tyOrigin)
        {
            Regex re = new Regex(@"^(?<gt>\d+),(?<side>\d+),(?<tx>\d+),(?<ty>\d+),(?<wf>\d+),(?<health>\d+),(?<aggr>\d+)(,\{(?<cab>.*)\})?$");
            Match m  = re.Match(strValue);

            m_aggr = (Aggressiveness)int.Parse(m.Groups["aggr"].Value);
            if (m.Groups["cab"] != null)
            {
                m_cab = UnitActionLoader.LoadIni(m.Groups["cab"].Value);
            }
        }
Esempio n. 2
0
        // ISerializable methods for backwards compatibility
        private UnitGroup(SerializationInfo info, StreamingContext context)
        {
            m_strName = info.GetString("m_strName");
            m_side = (Side)info.GetValue("m_side", typeof(Side));
            m_alsActions = (ArrayList)info.GetValue("m_alsActions", typeof(ArrayList));
            m_alsUnitTypeAndCounts = (ArrayList)info.GetValue("m_alsUnitTypeAndCounts", typeof(ArrayList));

            try {
                m_fLoopForever = info.GetBoolean("m_fLoopForever");
            } catch (SerializationException) {
                m_fLoopForever = false;
            }

            try {
                m_aggr = (Aggressiveness)info.GetValue("m_aggr", typeof(Aggressiveness));
            } catch (SerializationException) {
                m_aggr = Aggressiveness.Defender;
            }

            try {
                m_fRandomGroup = info.GetBoolean("m_fRandomGroup");
                m_fSpawn = info.GetBoolean("m_fSpawn");
                m_fCreateAtLevelLoad = info.GetBoolean("m_fCreateAtLevelLoad");
            } catch (SerializationException) {
                m_fRandomGroup = false;
                m_fSpawn = false;
                m_fCreateAtLevelLoad = false;
            }

            try {
                m_fReplaceDestroyedGroup = info.GetBoolean("m_fReplaceDestroyedGroup");
            } catch (SerializationException) {
                try {
                    m_fReplaceDestroyedGroup = info.GetBoolean("m_fReplaceDestroyedUnits");
                } catch (SerializationException) {
                    m_fReplaceDestroyedGroup = false;
                }
            }

            try {
                m_strSpawnArea = info.GetString("m_strSpawnArea");
            } catch (SerializationException) {
                m_strSpawnArea = null;
            }

            try {
                m_nHealth = info.GetInt32("m_nHealth");
            } catch (SerializationException) {
                m_nHealth = 100;
            }
        }
Esempio n. 3
0
        // ISerializable methods for backwards compatibility

        private UnitGroup(SerializationInfo info, StreamingContext context)
        {
            m_strName              = info.GetString("m_strName");
            m_side                 = (Side)info.GetValue("m_side", typeof(Side));
            m_alsActions           = (ArrayList)info.GetValue("m_alsActions", typeof(ArrayList));
            m_alsUnitTypeAndCounts = (ArrayList)info.GetValue("m_alsUnitTypeAndCounts", typeof(ArrayList));

            try {
                m_fLoopForever = info.GetBoolean("m_fLoopForever");
            } catch (SerializationException) {
                m_fLoopForever = false;
            }

            try {
                m_aggr = (Aggressiveness)info.GetValue("m_aggr", typeof(Aggressiveness));
            } catch (SerializationException) {
                m_aggr = Aggressiveness.Defender;
            }

            try {
                m_fRandomGroup       = info.GetBoolean("m_fRandomGroup");
                m_fSpawn             = info.GetBoolean("m_fSpawn");
                m_fCreateAtLevelLoad = info.GetBoolean("m_fCreateAtLevelLoad");
            } catch (SerializationException) {
                m_fRandomGroup       = false;
                m_fSpawn             = false;
                m_fCreateAtLevelLoad = false;
            }

            try {
                m_fReplaceDestroyedGroup = info.GetBoolean("m_fReplaceDestroyedGroup");
            } catch (SerializationException) {
                try {
                    m_fReplaceDestroyedGroup = info.GetBoolean("m_fReplaceDestroyedUnits");
                } catch (SerializationException) {
                    m_fReplaceDestroyedGroup = false;
                }
            }

            try {
                m_strSpawnArea = info.GetString("m_strSpawnArea");
            } catch (SerializationException) {
                m_strSpawnArea = null;
            }

            try {
                m_nHealth = info.GetInt32("m_nHealth");
            } catch (SerializationException) {
                m_nHealth = 100;
            }
        }
Esempio n. 4
0
        public MobileUnit(SerializationInfo info, StreamingContext ctx) : base(info, ctx)
        {
            try {
                m_aggr = (Aggressiveness)info.GetInt32("Aggressiveness");
            } catch (SerializationException) {
                m_aggr = Aggressiveness.Defender;
            }

            try {
                m_cab = (CaBase)info.GetValue("Action", typeof(CaBase));
            } catch (SerializationException) {
                m_cab = new GuardUnitAction();
            }
            Init();
        }
Esempio n. 5
0
 public UnitGroup(string strName)
 {
     m_strName = strName;
     m_side = Side.side2;
     m_aggr = Aggressiveness.Defender;
     m_alsActions = new ArrayList();
     m_alsUnitTypeAndCounts = new ArrayList();
     m_fLoopForever = false;
     m_fRandomGroup = false;
     m_fSpawn = false;
     m_fCreateAtLevelLoad = false;
     m_fReplaceDestroyedGroup = false;
     m_strSpawnArea = null;
     m_nHealth = 100;
 }
Esempio n. 6
0
 public UnitGroup(string strName)
 {
     m_strName                = strName;
     m_side                   = Side.side2;
     m_aggr                   = Aggressiveness.Defender;
     m_alsActions             = new ArrayList();
     m_alsUnitTypeAndCounts   = new ArrayList();
     m_fLoopForever           = false;
     m_fRandomGroup           = false;
     m_fSpawn                 = false;
     m_fCreateAtLevelLoad     = false;
     m_fReplaceDestroyedGroup = false;
     m_strSpawnArea           = null;
     m_nHealth                = 100;
 }
Esempio n. 7
0
            public VAD(uint frameSize, int sampleRate, Aggressiveness mode = Aggressiveness.Normal)
            {
                _frameSize  = frameSize;
                _sampleRate = sampleRate;

                if (!IsValidUsage(sampleRate, frameSize))
                {
                    throw new WebRtcVadException(Log.PossibleBugMessage("Failed to initialize WebRTC VAD (incorrect frame size or sample rate)", "E74CF7D3-51C0-4240-B552-02EB58EAE34D"));
                }

                //Create handle
                _handle = WebRtcVadNativeMethods.Dissonance_WebRtcVad_Create();
                if (WebRtcVadNativeMethods.Dissonance_WebRtcVad_Init(_handle) != 0)
                {
                    throw new WebRtcVadException(Log.PossibleBugMessage("Failed to initialize WebRTC VAD", "87596AD8-9096-4FEB-867D-B23A1A7F7F91"));
                }

                //Initialize defaults
                Mode = mode;
            }
Esempio n. 8
0
 public RocketVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 9
0
        public MobileUnit(SerializationInfo info, StreamingContext ctx)
            : base(info, ctx)
        {
            try {
                m_aggr = (Aggressiveness)info.GetInt32("Aggressiveness");
            } catch (SerializationException) {
                m_aggr = Aggressiveness.Defender;
            }

            try {
                m_cab = (CaBase)info.GetValue("Action", typeof(CaBase));
            } catch (SerializationException) {
                m_cab = new GuardUnitAction();
            }
            Init();
        }
Esempio n. 10
0
        public MobileUnit(string strName, string strValue, int txOrigin,
				int tyOrigin)
            : base(strName, strValue, txOrigin, tyOrigin)
        {
            Regex re = new Regex(@"^(?<gt>\d+),(?<side>\d+),(?<tx>\d+),(?<ty>\d+),(?<wf>\d+),(?<health>\d+),(?<aggr>\d+)(,\{(?<cab>.*)\})?$");
            Match m = re.Match(strValue);
            m_aggr = (Aggressiveness)int.Parse(m.Groups["aggr"].Value);
            if (m.Groups["cab"] != null) {
                m_cab = UnitActionLoader.LoadIni(m.Groups["cab"].Value);
            }
        }
Esempio n. 11
0
 public MobileUnit(Side side, int tx, int ty)
     : base(side, tx, ty)
 {
     m_aggr = Aggressiveness.Defender;
     m_cab = new GuardUnitAction();
 }
Esempio n. 12
0
 public MobileUnit(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty)
 {
     m_aggr = aggr;
     m_cab = cab;
 }
Esempio n. 13
0
 public GalaxMiner(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
     m_aggr = Aggressiveness.Coward;
 }
Esempio n. 14
0
 public MobileHeadquarters(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
     m_aggr = Aggressiveness.Coward;
 }
Esempio n. 15
0
 public Artillery(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 16
0
 public Fox(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 17
0
 internal static extern int Dissonance_WebRtcVad_set_mode(IntPtr handle, Aggressiveness mode);
Esempio n. 18
0
 public ShortRangeInfantry(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 19
0
 public TakeoverSpecialist(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
     m_aggr = Aggressiveness.Coward;
 }
Esempio n. 20
0
 public LongRangeInfantry(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 21
0
 public RocketVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 22
0
 public MobileUnit(Side side, int tx, int ty) : base(side, tx, ty)
 {
     m_aggr = Aggressiveness.Defender;
     m_cab  = new GuardUnitAction();
 }
Esempio n. 23
0
 public MobileUnit(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty)
 {
     m_aggr = aggr;
     m_cab  = cab;
 }
Esempio n. 24
0
 public TakeoverSpecialist(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
     m_aggr = Aggressiveness.Coward;
 }
Esempio n. 25
0
 public MachineGunVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 26
0
 private void InitializeDefault()
 {
     AggressivenessType = Aggressiveness.Passive;
 }
Esempio n. 27
0
 public MediumTank(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 28
0
 public GalaxMiner(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
     m_aggr = Aggressiveness.Coward;
 }
Esempio n. 29
0
 public MobileHeadquarters(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
     m_aggr = Aggressiveness.Coward;
 }
Esempio n. 30
0
 public MachineGunVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab)
     : base(side, tx, ty, aggr, cab)
 {
 }
Esempio n. 31
0
 public MediumTank(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab)
 {
 }