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); } }
// 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; } }
// 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; } }
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(); }
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; }
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; }
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; }
public RocketVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
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(); }
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); } }
public MobileUnit(Side side, int tx, int ty) : base(side, tx, ty) { m_aggr = Aggressiveness.Defender; m_cab = new GuardUnitAction(); }
public MobileUnit(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty) { m_aggr = aggr; m_cab = cab; }
public GalaxMiner(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { m_aggr = Aggressiveness.Coward; }
public MobileHeadquarters(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { m_aggr = Aggressiveness.Coward; }
public Artillery(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
public Fox(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
internal static extern int Dissonance_WebRtcVad_set_mode(IntPtr handle, Aggressiveness mode);
public ShortRangeInfantry(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
public TakeoverSpecialist(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { m_aggr = Aggressiveness.Coward; }
public LongRangeInfantry(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
public RocketVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
public MobileUnit(Side side, int tx, int ty) : base(side, tx, ty) { m_aggr = Aggressiveness.Defender; m_cab = new GuardUnitAction(); }
public MobileUnit(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty) { m_aggr = aggr; m_cab = cab; }
public TakeoverSpecialist(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { m_aggr = Aggressiveness.Coward; }
public MachineGunVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
private void InitializeDefault() { AggressivenessType = Aggressiveness.Passive; }
public MediumTank(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
public GalaxMiner(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { m_aggr = Aggressiveness.Coward; }
public MobileHeadquarters(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { m_aggr = Aggressiveness.Coward; }
public MachineGunVehicle(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }
public MediumTank(Side side, int tx, int ty, Aggressiveness aggr, CaBase cab) : base(side, tx, ty, aggr, cab) { }