public void StartGame(PetRecord selfPet, PetRecord aimPet, long groupNum, string bindAi) { var engine = new PetAgainstEngine() { SelfPet = new GamingPet() { Name = selfPet.Name, HP = PetLevelSvc[selfPet.Level].HP, QQNum = selfPet.QQNum, Skills = new Dictionary <string, int>(selfPet.Skills), Level = selfPet.Level }, AimPet = new GamingPet() { Name = aimPet.Name, HP = PetLevelSvc[aimPet.Level].HP, QQNum = aimPet.QQNum, Skills = new Dictionary <string, int>(aimPet.Skills), Level = aimPet.Level }, GroupNum = groupNum, BindAi = bindAi }; Engines.Add(engine); engine.StartGame(); Engines.Remove(engine); }
void Refresh() { try { Engines.Clear(); foreach (var item in new EnginesRequest().Response.Engines.Data.Select(d => new Item() { Name = d["title"], Value = d["name"], Data = d })) { Engines.Add(item); } Markets.Clear(); Securities.Clear(); Boards.Clear(); Info = ""; History = new List <HistoryObject>(); FirePropertyChanged(nameof(Info)); FirePropertyChanged(nameof(History)); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); } }
public void AddEngine(EngineTypes engineType) { if (!Engines.Contains(engineType)) { Engines.Add(engineType); } }
public void Add(EngineWrapper e) { Engines.Add(e); MaxThrust = MaxThrust + VSL.LocalDir(e.defThrustDir) * e.engine.maxThrust; MaxMassFlow = MaxMassFlow + e.engine.maxFuelFlow; Dir = MaxThrust.normalized; }
public SnipsNLUService(string engineDirectory) : base() { EnginesDirectory = new DirectoryInfo(engineDirectory); if (!EnginesDirectory.Exists) { return; } var dirs = EnginesDirectory.EnumerateDirectories(); foreach (var d in dirs) { var e = new SnipsNLUEngine(d.FullName, Api.Ct); if (e.Initialized) { Engines.Add(d.Name, e); } } if (Engines.Count == 0) { Error("Did not initialize any Snips NLU engines from directory {0}", engineDirectory); return; } else { Initialized = true; Info("Initialized {0} Snips NLU engines: {1}.", Engines.Count, Engines.Keys); } }
private void AddEngine() { MESEngine engine = new MESEngine(); MESEngineViewModel vm = new MESEngineViewModel(engine); Engines.Add(vm); _mes.engines.Add(engine); }
public void Add(params EngineWrapper[] engines) { for (int i = 0, len = engines.Length; i < len; i++) { var e = engines[i]; Engines.Add(e); MaxThrust = MaxThrust + VSL.LocalDir(e.defThrustDir) * e.engine.maxThrust; MaxMassFlow = MaxMassFlow + e.engine.maxFuelFlow; } Dir = MaxThrust.normalized; }
private void _add(object obj) { var newEngine = new Model.Engine() { Servers = Model.Servers, ArchiveDirectories = Model.ArchiveDirectories, VolumeReferenceLoudness = -23.0 }; Model.EngineList.Add(newEngine); var newPlayoutServerViewmodel = new EngineViewmodel(newEngine); Engines.Add(newPlayoutServerViewmodel); SelectedEngine = newPlayoutServerViewmodel; }
/// <summary> /// Get the Engine /// </summary> /// <param name="phase"></param> /// <returns></returns> protected override EngineBase GetEngine(ResourceExecutionPhase phase) { EngineBase engine = null; if (!Engines.TryGetValue(phase, out engine)) { var detail = GetFilteredWorkerDetail(phase); engine = ObjectFactory.Create <EngineBase>(detail.ExecutionMode, detail); engine.ActivityStateChanged += OnActivityStateChanged; Engines.Add(phase, engine); } return(engine); }
/// <summary> /// Constructs the server game instance. /// </summary> public ServerGameInstance() { try { StackNoteHelper.Push("ServerGameInstance construction, preparating of default engine", this); Engines.Add(new ServerEngine() { OwningInstance = this }); DefaultEngine.LoadBasic(); } finally { StackNoteHelper.Pop(); } }
private void GetEngines() { using (var unitOfWork = new UnitOfWork()) { if (!Engines.Any()) { Engines.Clear(); Engines.Add(new Engine() { engine_designation = "" }); Engines.AddRange(unitOfWork.EngineRepository.GetAll()); } engineBindingSource.DataSource = Engines; } }
protected virtual EngineBase GetEngine(ResourceExecutionPhase phase) { EngineBase engine = null; if (!Engines.TryGetValue(phase, out engine)) { var details = GetFilteredWorkerDetail(phase); if (phase != ResourceExecutionPhase.Main) { details.ExecutionMode = ExecutionMode.Iteration; details.RepeatCount = 1; } TraceFactory.Logger.Debug("Creating engine for {0} Phase".FormatWith(phase)); engine = ObjectFactory.Create <EngineBase>(details.ExecutionMode, details); engine.ActivityStateChanged += OnActivityStateChanged; Engines.Add(phase, engine); } return(engine); }
public void Run() { if (null != engine) { if (pluginFileInfo.Extension == ".cs" || pluginFileInfo.Extension == ".lm" || pluginFileInfo.Extension == ".dll") { if (pluginFileInfo.Extension == ".cs" || pluginFileInfo.Extension == ".lm") { if (!engine.Compile(String.Empty)) { foreach (string error in engine.Errors) { Config.ConsoleEx.WriteLine("Error compiling plug-in (" + engine.FileName + ")" + Environment.NewLine + Environment.NewLine + error); } return; } } if (!engine.Run()) { foreach (string error in engine.Errors) { Config.ConsoleEx.WriteLine("Error running plug-in (" + engine.FileName + ")" + Environment.NewLine + Environment.NewLine + error); } } else { if (null == engines) { engines = new List <PluginEngine>(); } Engines.Add(engine); } } } }
public void AddEngine(Engine engine) { Engines.Add(engine); }
public void addEngines(GameObject engine) { Engines.Add(engine); }
public void addEngine(Engine engine) => Engines.Add(engine);
/// <summary> /// Every faction will start with some components defined and ready to use, though the engines and sensors shouldn't be here just yet. /// </summary> public void AddInitialComponents() { /// <summary> /// Watch total component count when adding or subtracting from this function /// </summary> TotalComponents = 0; GeneralComponentDefTN CrewQ = new GeneralComponentDefTN("Crew Quarters", 1.0f, 0, 10.0m, ComponentTypeTN.Crew); GeneralComponentDefTN CrewQS = new GeneralComponentDefTN("Crew Quarters - Small", 0.2f, 0, 2.0m, ComponentTypeTN.Crew); GeneralComponentDefTN FuelT = new GeneralComponentDefTN("Fuel Storage", 1.0f, 0, 10.0m, ComponentTypeTN.Fuel); GeneralComponentDefTN FuelTS = new GeneralComponentDefTN("Fuel Storage - Small", 0.2f, 0, 3.0m, ComponentTypeTN.Fuel); GeneralComponentDefTN EBay = new GeneralComponentDefTN("Engineering Spaces", 1.0f, 5, 10.0m, ComponentTypeTN.Engineering); GeneralComponentDefTN Bridge = new GeneralComponentDefTN("Bridge", 1.0f, 5, 10.0m, ComponentTypeTN.Bridge); TotalComponents = TotalComponents + 6; CrewQuarters.Add(CrewQ); CrewQuarters.Add(CrewQS); FuelStorage.Add(FuelT); FuelStorage.Add(FuelTS); EngineeringSpaces.Add(EBay); OtherComponents.Add(Bridge); /// <summary> /// These components aren't really basic, but I'll put them in anyway for the time being. Count 6 to 17 /// </summary> EngineDefTN EngDef = new EngineDefTN("25 EP Nuclear Thermal Engine", 5.0f, 1.0f, 1.0f, 1.0f, 1, 5, -1.0f); ActiveSensorDefTN ActDef = new ActiveSensorDefTN("Search 5M - 5000", 1.0f, 10, 5, 100, false, 1.0f, 1); PassiveSensorDefTN ThPasDef = new PassiveSensorDefTN("Thermal Sensor TH1-5", 1.0f, 5, PassiveSensorType.Thermal, 1.0f, 1); PassiveSensorDefTN EMPasDef = new PassiveSensorDefTN("EM Sensor EM1-5", 1.0f, 5, PassiveSensorType.EM, 1.0f, 1); BeamFireControlDefTN BFCDef = new BeamFireControlDefTN("Fire Control S01 10-1250", 0, 0, 1.0f, 1.0f, false, false, 1.0f, 1); BeamDefTN BeamDef = new BeamDefTN("10cm C1 Infrared Laser", ComponentTypeTN.Laser, 0, 0, 0, 1.0f); ReactorDefTN ReactDef = new ReactorDefTN("PWR S1 P2", 0, 1.0f, 1.0f); ShieldDefTN AShieldDef = new ShieldDefTN("Alpha R300/240 Shields", 0, 0, 1.0f, 1.0f, ComponentTypeTN.Shield); MissileLauncherDefTN TubeDef = new MissileLauncherDefTN("Size 1 Launcher", 1.0f, 1, false, 0); MagazineDefTN MagDef = new MagazineDefTN("Mag S1", 1.0f, 1, 0, 0, 1); ActiveSensorDefTN MFCDef = new ActiveSensorDefTN("Wasp I FC", 1.0f, 10, 5, 100, true, 1.0f, 1); TotalComponents = TotalComponents + 11; Engines.Add(EngDef); ActiveSensorDef.Add(ActDef); PassiveSensorDef.Add(ThPasDef); PassiveSensorDef.Add(EMPasDef); BeamFireControlDef.Add(BFCDef); BeamWeaponDef.Add(BeamDef); ReactorDef.Add(ReactDef); ShieldDef.Add(AShieldDef); MLauncherDef.Add(TubeDef); MagazineDef.Add(MagDef); MissileFireControlDef.Add(MFCDef); TurretableBeamDef.Add(BeamDef); /// <summary> /// Everyone starts with cargoholds. Count 17 to 19 /// </summary> CargoDefTN CargoStandard = new CargoDefTN("Cargo Hold - Standard", 500.0f, 50.0m, 5); CargoDefTN CargoSmall = new CargoDefTN("Cargo Hold - Small", 100.0f, 12.5m, 2); TotalComponents = TotalComponents + 2; CargoHoldDef.Add(CargoStandard); CargoHoldDef.Add(CargoSmall); /// <summary> /// Cryostorage is a TN only starting option. otherwise it must be researched. Count, 19 to 22 /// </summary> ColonyDefTN ColonyStandard = new ColonyDefTN("Cryogenic Transport", 50.0f, 100.0m, 10); ColonyDefTN ColonySmall = new ColonyDefTN("Cryogenic Transport - Small", 5.0f, 20.0m, 2); ColonyDefTN ColonyEmergency = new ColonyDefTN("Cryogenic Transport - Emergency", 1.0f, 5.0m, 0); TotalComponents = TotalComponents + 3; ColonyBayDef.Add(ColonyStandard); ColonyBayDef.Add(ColonySmall); ColonyBayDef.Add(ColonyEmergency); /// <summary> /// Only TN starts begin with this component for now. the improved,advanced, and grav-assisted variants have to be researched. Count 22, to 23 /// </summary> CargoHandlingDefTN CHS = new CargoHandlingDefTN("Cargo Handling System", 5, 10.0m); CargoHandleSystemDef.Add(CHS); TotalComponents = TotalComponents + 1; /// <summary> /// Alpha build components: Count 23, to 39 /// </summary> EngineDefTN AlphaEngine = new EngineDefTN("Ion Engine 120", 12.0f, 1.0f, 0.7f, 1.0f, 1, 10.0f, -1.0f); ActiveSensorDefTN AlphaBigSensor = new ActiveSensorDefTN("Search 181M - 10000", 10.0f, 16, 8, 200, false, 1.0f, 1); ActiveSensorDefTN AlphaSmallSensor = new ActiveSensorDefTN("Search 57M - 1000", 10.0f, 16, 8, 20, false, 1.0f, 1); ActiveSensorDefTN AlphaMissileSensor = new ActiveSensorDefTN("Search 1.4M - Missile", 10.0f, 16, 8, 1, false, 1.0f, 1); PassiveSensorDefTN AlphaEMSensor = new PassiveSensorDefTN("EM Detection Sensor EM10-80", 10.0f, 8, PassiveSensorType.EM, 1.0f, 1); PassiveSensorDefTN AlphaTHSensor = new PassiveSensorDefTN("TH Detection Sensor TH10-80", 10.0f, 8, PassiveSensorType.Thermal, 1.0f, 1); BeamFireControlDefTN AlphaFireControl = new BeamFireControlDefTN("Primary III FC R96K T6K", 2, 2, 4.0f, 2.0f, false, false, 1.0f, 1); BeamDefTN AlphaRailGun = new BeamDefTN("15cm Railgun V3/C3", ComponentTypeTN.Rail, 2, 2, 2, 1.0f); BeamDefTN AlphaLaser = new BeamDefTN("15cm C3 Near UV Laser", ComponentTypeTN.Laser, 2, 2, 2, 1.0f); BeamDefTN AlphaParticle = new BeamDefTN("PBW-4 150K", ComponentTypeTN.Particle, 2, 2, 2, 1.0f); BeamDefTN AlphaPlasma = new BeamDefTN("15cm C3 Plasma Beam", ComponentTypeTN.Plasma, 2, 2, 2, 1.0f); BeamDefTN AlphaMeson = new BeamDefTN("R9/C3 Meson Cannon", ComponentTypeTN.Meson, 2, 2, 2, 1.0f); BeamDefTN AlphaHPM = new BeamDefTN("R9/C3 Microwave", ComponentTypeTN.Microwave, 2, 2, 2, 1.0f); BeamDefTN AlphaGauss = new BeamDefTN("Gauss R3-100", ComponentTypeTN.Gauss, 0, 2, 2, 1.0f); ReactorDefTN AlphaReactor = new ReactorDefTN("GCFR S1 P4.5", 2, 1.0f, 1.0f); ShieldDefTN AlphaShield = new ShieldDefTN("Gamma R300/336 Shields", 2, 2, 0.7f, 1.0f, ComponentTypeTN.Shield); TotalComponents = TotalComponents + 16; Engines.Add(AlphaEngine); ActiveSensorDef.Add(AlphaBigSensor); ActiveSensorDef.Add(AlphaSmallSensor); ActiveSensorDef.Add(AlphaMissileSensor); PassiveSensorDef.Add(AlphaEMSensor); PassiveSensorDef.Add(AlphaTHSensor); BeamFireControlDef.Add(AlphaFireControl); BeamWeaponDef.Add(AlphaRailGun); BeamWeaponDef.Add(AlphaLaser); BeamWeaponDef.Add(AlphaParticle); BeamWeaponDef.Add(AlphaPlasma); BeamWeaponDef.Add(AlphaMeson); BeamWeaponDef.Add(AlphaHPM); BeamWeaponDef.Add(AlphaGauss); ReactorDef.Add(AlphaReactor); ShieldDef.Add(AlphaShield); TurretableBeamDef.Add(AlphaLaser); TurretableBeamDef.Add(AlphaMeson); TurretableBeamDef.Add(AlphaGauss); /// <summary> /// Missile Combat Alpha Components: Count at 44 from 39 OrdnanceDefTN and MissileEngineDefTN are _NOT_ included in the total count. /// </summary> EngineDefTN AlphaMCEngine = new EngineDefTN("Military 5000 EP Photonic Drive", 100.0f, 1.0f, 0.1f, 1.0f, 1, 50.0f, -1.0f); ActiveSensorDefTN AlphaMCSensor = new ActiveSensorDefTN("Active Search Sensor MR13500-R100", 10.0f, 180, 75, 100, false, 1.0f, 0); ActiveSensorDefTN AlphaMCMissileFireControl = new ActiveSensorDefTN("Missile Fire Control FC40500-R100", 10.0f, 180, 75, 100, true, 1.0f, 0); MagazineDefTN MagazineMCDef = new MagazineDefTN("Capacity 587 Magazine: Exp 1% HTK4", 30.0f, 4, 8, 8, 12); MissileLauncherDefTN TubeMCDef = new MissileLauncherDefTN("Size 4 Launcher", 4.0f, 11, false, 0); MissileEngineDefTN MissileEngineMCDef = new MissileEngineDefTN("Photonic Missile Drive", 100.0f, 1.0f, 0.1f, 1.5f); OrdnanceDefTN MissileMCDef = new OrdnanceDefTN("Size 4 Missile", null, 0.5f, 11, 1.0f, 1.0f, 11, 0.0f, 0, 0.0f, 0, 0.0f, 0, 0.0f, 0, 100, 0, 0.0f, 0.0f, 0, false, 0, false, 0, MissileEngineMCDef, 1); TotalComponents = TotalComponents + 5; Engines.Add(AlphaMCEngine); ActiveSensorDef.Add(AlphaMCSensor); MissileFireControlDef.Add(AlphaMCMissileFireControl); MagazineDef.Add(MagazineMCDef); MLauncherDef.Add(TubeMCDef); MissileEngineDef.Add(MissileEngineMCDef); MissileDef.Add(MissileMCDef); MissileLauncherDefTN TubeAMMDef = new MissileLauncherDefTN("Size 1 Launcher", 1.0f, 11, false, 0); MissileEngineDefTN MissileEngineAMMDef = new MissileEngineDefTN("Small Photonic Missile Drive", 100.0f, 6.0f, 0.1f, 0.4f); ActiveSensorDefTN AMMSensor = new ActiveSensorDefTN("AMM Sensor", 10.0f, 180, 75, 1, false, 1.0f, 0); ActiveSensorDefTN AMMMFC = new ActiveSensorDefTN("AMM MFC", 10.0f, 180, 75, 1, true, 1.0f, 0); OrdnanceDefTN MissileAMMDef = new OrdnanceDefTN("Size 1 Missile", null, 0.14f, 11, 0.23f, 0.23f, 11, 0.0f, 0, 0.0f, 0, 0.0f, 0, 0.0f, 0, 1, 0, 0.0f, 0.0f, 0, false, 0, false, 0, MissileEngineAMMDef, 1); TotalComponents = TotalComponents + 3; MLauncherDef.Add(TubeAMMDef); MissileEngineDef.Add(MissileEngineAMMDef); ActiveSensorDef.Add(AMMSensor); MissileFireControlDef.Add(AMMMFC); MissileDef.Add(MissileAMMDef); /// <summary> /// Sensor components should be added upon researching the appropriate technology, as they cannot be designed, Count should be at 46 /// </summary> SurveySensorDefTN GeoSurvey = new SurveySensorDefTN("Geological Survey Sensor", SurveySensorDefTN.SurveySensorType.Geological, 1.0f); SurveySensorDefTN GravSurvey = new SurveySensorDefTN("Gravitational Survey Sensor", SurveySensorDefTN.SurveySensorType.Gravitational, 1.0f); SurveySensorDef.Add(GeoSurvey); SurveySensorDef.Add(GravSurvey); TotalComponents = TotalComponents + 2; }