public override void Initialize (EngineController controller) { base.Initialize (controller); controller.BuildingType += new EventHandler<EngineEventArgs> (OnType); assemblies.Clear (); namespaces.Clear (); }
public void when_there_is_only_one_type() { // GrammarSystem is the only type in the Samples project var path = TestingContext.FindParallelDirectory("Storyteller.Samples"); var project = Project.LoadForFolder(path); var controller = new EngineController(project, new AppDomainSystemLauncher(project)); }
private Task<SystemRecycled> start(string projectName) { _project = new Project { ProjectPath = TestingContext.FindParallelDirectory(projectName) }; _controller = new EngineController(_project, new ProcessRunnerSystemLauncher(_project)); return _controller.Start(); }
/// <summary> /// This method is called by task creator to associate the trace data with /// the current instance of virtual machine. The given WorkspaceModel can /// optionally contain saved trace data in a previous execution session. As /// a side-effect, this method resets "WorkspaceModel.PreloadedTraceData" /// data member to ensure the correctness of the execution flow. /// </summary> /// <param name="controller">Reference to the EngineController on which the /// loaded trace data should be set.</param> /// <param name="workspace">The workspace from which the trace data should /// be retrieved.</param> /// <returns>If the given WorkspaceModel contains saved trace data, this /// method returns true, in which case the task needs to be scheduled. /// Otherwise, the method returns false.</returns> /// internal bool Initialize(EngineController controller, WorkspaceModel workspace) { if (controller == null || (controller.LiveRunnerCore == null)) return false; engineController = controller; traceData = workspace.PreloadedTraceData; TargetedWorkspace = workspace; workspace.PreloadedTraceData = null; return ((traceData != null) && traceData.Any()); }
/// <summary> /// Call this method to intialize a CompileCustomNodeAsyncTask with an /// EngineController, nodes from the corresponding CustomNodeWorkspaceModel, /// and inputs/outputs of the CustomNodeDefinition. /// </summary> /// <param name="initParams">Input parameters required for compilation of /// the CustomNodeDefinition.</param> /// <returns>Returns true if GraphSyncData is generated successfully and /// that the CompileCustomNodeAsyncTask should be scheduled for execution. /// Returns false otherwise.</returns> /// internal bool Initialize(CompileCustomNodeParams initParams) { engineController = initParams.EngineController; try { graphSyncData = engineController.ComputeSyncData(initParams); return graphSyncData != null; } catch (Exception) { return false; } }
/// <summary> /// This method is called by codes that intent to start a graph update. /// This method is called on the main thread where node collection in a /// WorkspaceModel can be safely accessed. /// </summary> /// <param name="controller">Reference to an instance of EngineController /// to assist in generating GraphSyncData object for the given set of nodes. /// </param> /// <param name="workspace">Reference to the WorkspaceModel from which a /// set of updated nodes is computed. The EngineController generates the /// resulting GraphSyncData from this list of updated nodes.</param> /// <returns>Returns true if there is any GraphSyncData, or false otherwise /// (in which case there will be no need to schedule UpdateGraphAsyncTask /// for execution).</returns> /// internal bool Initialize(EngineController controller, WorkspaceModel workspace) { try { engineController = controller; TargetedWorkspace = workspace; modifiedNodes = ComputeModifiedNodes(workspace); graphSyncData = engineController.ComputeSyncData(modifiedNodes); return graphSyncData != null; } catch (Exception) { return false; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public override void Dispose() { base.Dispose(); if (EngineController != null) { EngineController.MessageLogged -= Log; EngineController.LibraryServices.LibraryLoaded -= LibraryLoaded; EngineController.Dispose(); } if (pulseMaker == null) { return; } pulseMaker.Stop(); }
public override void Initialize (EngineController controller) { base.Initialize (controller); controller.BuildingAssembly += new EventHandler<EngineEventArgs> (OnAssembly); mapper = new Dictionary<string,string> (); foreach (IRule rule in Controller.Runner.Rules) { Type type = rule.GetType (); object [] attrs = type.GetCustomAttributes (fxCopCompatibility, true); if (attrs.Length == 0) continue; // one Gendarme rule can be mapped to several FxCop rules // one FxCop rules can be split across several Gendarme rules foreach (FxCopCompatibilityAttribute attr in attrs) { mapper.Add (attr.Category + "." + attr.CheckId, rule.FullName); } } }
/// <summary> /// Create hight lighting rule for method. /// </summary> /// <returns></returns> public static HighlightingRule CreateMethodHighlightRule(EngineController engineController) { Color color = (Color)ColorConverter.ConvertFromString("#417693"); var methodHighlightRule = new HighlightingRule { Color = new HighlightingColor() { Foreground = new CodeHighlightingRuleFactory.CustomizedBrush(color) } }; var wordList = engineController.CodeCompletionServices.GetGlobals(); String regex = String.Format(@"\b({0})({0})?\b", String.Join("|", wordList)); methodHighlightRule.Regex = new Regex(regex); return(methodHighlightRule); }
/// <summary> /// Recompile all custom nodes /// </summary> public void RecompileAllNodes(EngineController engine) { var compiledNodes = new HashSet <Guid>(); var enumerator = LoadedCustomNodes.GetEnumerator(); while (enumerator.MoveNext()) { var guid = (Guid)enumerator.Key; var def = enumerator.Value as CustomNodeDefinition; if (!compiledNodes.Contains(guid)) { def.Compile(this.dynamoModel, engine); compiledNodes.Add(guid); } } }
/// <summary> /// Create hight lighting rule for class. /// </summary> /// <param name="engineController"></param> /// <returns></returns> public static HighlightingRule CreateClassHighlightRule(EngineController engineController) { Color color = (Color)ColorConverter.ConvertFromString("#2E998F"); var classHighlightRule = new HighlightingRule { Color = new HighlightingColor() { Foreground = new CodeHighlightingRuleFactory.CustomizedBrush(color) } }; var wordList = engineController.CodeCompletionServices.GetClasses(); String regex = String.Format(@"\b({0})\b", String.Join("|", wordList)); classHighlightRule.Regex = new Regex(regex); return(classHighlightRule); }
public void RunExpression(int?executionInterval = null) { //dynSettings.Controller.DynamoLogger.LogWarning("Running expression", WarningLevel.Mild); //If we're already running, do nothing. if (Running) { return; } // If there is preloaded trace data, send that along to the current // LiveRunner instance. Here we make sure it is done exactly once // by resetting WorkspaceModel.PreloadedTraceData property after it // is obtained. // var traceData = DynamoViewModel.Model.HomeSpace.PreloadedTraceData; DynamoViewModel.Model.HomeSpace.PreloadedTraceData = null; // Reset. EngineController.LiveRunnerCore.SetTraceDataForNodes(traceData); EngineController.GenerateGraphSyncData(DynamoViewModel.Model.HomeSpace.Nodes); if (!EngineController.HasPendingGraphSyncData) { return; } //We are now considered running Running = true; if (!testing) { //Setup background worker DynamoViewModel.RunEnabled = false; //Let's start evaluationWorker.RunWorkerAsync(executionInterval); } else { //for testing, we do not want to run asynchronously, as it will finish the //test before the evaluation (and the run) is complete RunThread(evaluationWorker, new DoWorkEventArgs(executionInterval)); } }
/// <summary> /// This method is called by code that intends to start a graph update. /// This method is called on the main thread where node collection in a /// WorkspaceModel can be safely accessed. /// </summary> /// <param name="controller">Reference to an instance of EngineController /// to assist in generating GraphSyncData object for the given set of nodes. /// </param> /// <param name="workspace">Reference to the WorkspaceModel from which a /// set of updated nodes is computed. The EngineController generates the /// resulting GraphSyncData from this list of updated nodes.</param> /// <returns>Returns true if there is any GraphSyncData, or false otherwise /// (in which case there will be no need to schedule UpdateGraphAsyncTask /// for execution).</returns> /// internal bool Initialize(EngineController controller, WorkspaceModel workspace) { try { engineController = controller; TargetedWorkspace = workspace; ModifiedNodes = ComputeModifiedNodes(workspace); graphSyncData = engineController.ComputeSyncData(workspace.Nodes, ModifiedNodes, verboseLogging); if (graphSyncData == null) { return(false); } if (engineController.ProfilingSession != null) { engineController.ProfilingSession.UnregisterDeletedNodes(workspace.Nodes); } // We clear dirty flags before executing the task. If we clear // flags after the execution of task, for example in // AsyncTask.Completed or in HandleTaskCompletionCore(), as both // are executed in the other thread, although some nodes are // modified and we request graph execution, but just before // computing sync data, the task completion handler jumps in // and clear dirty flags. Now graph sync data will be null and // graph is in wrong state. foreach (var nodeGuid in graphSyncData.NodeIDs) { var node = workspace.Nodes.FirstOrDefault(n => n.GUID.Equals(nodeGuid)); if (node != null) { node.ClearDirtyFlag(); } } return(true); } catch (Exception e) { System.Diagnostics.Debug.WriteLine("UpgradeGraphAsyncTask saw: " + e.ToString()); return(false); } }
void equipItems() { EngineController engine = GameObject.Find("Game Engine").GetComponent <EngineController>(); Item[] equipment = engine.playerEquipment; Item item1 = equipment[0]; Item item2 = equipment[1]; Item item3 = equipment[2]; Item item4 = equipment[3]; //Change base stats here moveSpeed = 10 + item1.bonusSpeed + item2.bonusSpeed + item3.bonusSpeed + item4.bonusSpeed; jumpForce = 20 + item1.bonusJump + item2.bonusJump + item3.bonusJump + item4.bonusJump; damage = 10 + item1.bonusAttack + item2.bonusAttack + item3.bonusAttack + item4.bonusAttack; health = 100 + item1.bonusHealth + item2.bonusHealth + item3.bonusHealth + item4.bonusHealth; HealthBar healthBar = GameObject.Find("HealthBar").GetComponentInChildren <HealthBar>(); healthBar.setStartHealth(health); }
private Element GetInputElement() { Element e = null; var owner = InPorts[0].Connectors[0].Start.Owner; var index = InPorts[0].Connectors[0].Start.Index; var name = owner.GetAstIdentifierForOutputIndex(index).Name; var mirror = EngineController.GetMirror(name); if (!mirror.GetData().IsCollection) { var element = (Revit.Elements.Element)mirror.GetData().Data; if (element != null) { e = element.InternalElement; } } return(e); }
private Level ResolveLevel(LevelType levelType) { Level level; switch (levelType) { case LevelType.TUTORIAL_1: level = new Level("Tutorial"); level.AppendTeardownHook(() => { Destroy(EngineController.Instance().gameObject); }); return(level); default: case LevelType.MAIN_MENU: level = new Level("StartMenu"); return(level); } }
public HomeWorkspaceModel( EngineController engine, DynamoScheduler scheduler, NodeFactory factory, IEnumerable <KeyValuePair <Guid, List <string> > > traceData, IEnumerable <NodeModel> e, IEnumerable <NoteModel> n, double x, double y, bool verboseLogging, bool isTestMode) : base("Home", e, n, x, y, factory) { RunEnabled = true; PreloadedTraceData = traceData; this.scheduler = scheduler; VerboseLogging = verboseLogging; ResetEngine(engine); runExpressionTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(100) }; runExpressionTimer.Tick += OnRunExpression; IsTestMode = isTestMode; }
public WorkspaceViewComparisonData(WorkspaceViewModel workspaceView, EngineController controller) : base(workspaceView.Model, controller) { NodeViewCount = workspaceView.Nodes.Count(); ConnectorViewCount = workspaceView.Connectors.Count(); NodeViewDataMap = new Dictionary <Guid, NodeViewComparisonData>(); AnnotationMap = new Dictionary <Guid, ExtraAnnotationViewInfo>(); foreach (var annotation in workspaceView.Annotations) { AnnotationMap.Add(annotation.AnnotationModel.GUID, new ExtraAnnotationViewInfo { Background = annotation.Background.ToString(), FontSize = annotation.FontSize, Nodes = annotation.Nodes.Select(x => x.GUID.ToString()), Title = annotation.AnnotationText, Id = annotation.AnnotationModel.GUID.ToString(), Left = annotation.Left, Top = annotation.Top, Width = annotation.Width, Height = annotation.Height, InitialTop = annotation.AnnotationModel.InitialTop, TextBlockHeight = annotation.AnnotationModel.TextBlockHeight }); } foreach (var n in workspaceView.Nodes) { NodeViewDataMap.Add(n.NodeModel.GUID, new NodeViewComparisonData { ShowGeometry = n.IsVisible, ID = n.NodeModel.GUID.ToString(), Name = n.Name, Excluded = n.IsFrozenExplicitly, X = n.X, Y = n.Y, }); } X = workspaceView.X; Y = workspaceView.Y; Zoom = workspaceView.Zoom; Camera = workspaceView.Camera; }
public HomeWorkspaceModel( EngineController engine, DynamoScheduler scheduler, NodeFactory factory, IEnumerable <KeyValuePair <Guid, List <string> > > traceData, IEnumerable <NodeModel> e, IEnumerable <NoteModel> n, double x, double y, bool verboseLogging, bool isTestMode, ElementResolver elementResolver, string fileName = "") : base("Home", e, n, x, y, factory, elementResolver, fileName) { RunEnabled = true; #if DEBUG DynamicRunEnabled = true; #else DynamicRunEnabled = false; #endif PreloadedTraceData = traceData; this.scheduler = scheduler; VerboseLogging = verboseLogging; IsTestMode = isTestMode; EngineController = engine; }
public override bool RequestVisualUpdateAsync(IScheduler scheduler, EngineController engine, IRenderPackageFactory factory, bool forceUpdate = true) { try { int index = OutPorts[0].Index; string name = GetAstIdentifierForOutputIndex(index).Name; RuntimeMirror mirror = engine.GetMirror(name); MirrorData data = mirror.GetData(); List <Autodesk.DesignScript.Geometry.Mesh> meshes = GetMeshes(data); _meshes = meshes; IRenderPackage render = factory.CreateRenderPackage(); foreach (Autodesk.DesignScript.Geometry.Mesh m in meshes) { if (m != null) { m.Tessellate(render, factory.TessellationParameters); //var method = render.GetType().GetMethod("SetTransform", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance, null, new[] { typeof(double[]) }, null); //if (method != null) //{ // method.Invoke(render, new object[] { new double[] // { // transform.XAxis.X, transform.XAxis.Y, transform.XAxis.Z, 0, // transform.YAxis.X, transform.YAxis.Y, transform.YAxis.Z, 0, // transform.ZAxis.X, transform.ZAxis.Y, transform.ZAxis.Z, 0, // transform.Origin.X, transform.Origin.Y, transform.Origin.Z, 1 // } // }); //} } } // NOTE: I'm not sure calling the Tessellate method from IGraphicItem is necessary here // but I've tried calling and am leaving it in here just in case I do wind up needing it. //Tessellate(render, factory.TessellationParameters); return(true); } catch { } return(false); }
public MainWindowViewmodel() { if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(new DependencyObject())) { return; } try { SplashScreenView.Current?.Notify("Initializing engines..."); EngineController.Initialize(); Tabs = new List <ViewModelBase>( EngineController.Engines.Select(engine => { SplashScreenView.Current?.Notify($"Creating {engine.EngineName}..."); return(new ChannelViewmodel(engine, true, true)); })); } catch (TypeInitializationException e) { MessageBox.Show(string.Format(resources._message_CantInitializeEngines, e.InnerException), resources._caption_Error, MessageBoxButton.OK, MessageBoxImage.Error); } catch (Exception e) { var exceptionToShow = e; while (exceptionToShow.InnerException != null) { exceptionToShow = exceptionToShow.InnerException; } var message = #if DEBUG $"{e}"; #else $"{exceptionToShow.GetType().Name} {exceptionToShow.Message}"; #endif MessageBox.Show(string.Format(resources._message_CantInitializeEngines, message), resources._caption_Error, MessageBoxButton.OK, MessageBoxImage.Error); Application.Current.Shutdown(1); } }
public void DisplayCommitDialog() { if (!EnabledVersionControls.Instance().CanCommit) { Debug.Log("Can't commit; not enabled"); return; } EngineController.Instance().ToggleControls(false); GameObject dialog = Instantiate(textButttonDialogTemplate, transform) as GameObject; TextButtonDialogController dialogController = dialog.GetComponent <TextButtonDialogController>(); dialogController.promptText.text = "git commit -m "; dialogController.titleText.text = "Enter a commit message"; dialogController.submitButton.enabled = false; dialogController.submitButton.GetComponentInChildren <Text>().text = "Commit"; dialogController.inputField.onValueChanged.AddListener((s) => { dialogController.submitButton.enabled = !s.Equals(""); }); dialogController.submitButton.onClick.AddListener(() => { Debug.Log("Button pressed"); string commitMessage = dialogController.inputField.text; VersionManager.Instance().Commit(commitMessage); Debug.Log("Commiting"); EngineController.Instance().ToggleControls(true); Destroy(dialog); } ); dialogController.submitButton.onClick.AddListener(() => { UpdateOverlay(); }); dialogController.inputField.Select(); if (commitDialogTrigger != null) { commitDialogTrigger.NotifyObservers(); } }
public run_command_integration_specs() { TestUtility.CleanUpHangingProcesses(); var directory = TestingContext.FindParallelDirectory("Storyteller.Samples"); var project = Project.LoadForFolder(directory); #if NET46 theController = new EngineController(project, new AppDomainSystemLauncher(project)); #else throw new NotImplementedException("Not done yet for CoreCLR"); #endif theInput = new RunInput { Path = directory, RetriesFlag = 1 }; theController = theInput.BuildEngine(); var task = theController.Start(); task.Wait(3.Seconds()); theFixtures = task.Result.fixtures; }
/// <summary> /// Retrieves input string from connected input node. /// </summary> /// <param name="engine"></param> /// <returns></returns> public string GetInputString(EngineController engine) { string htmlString; // If there is an input supplied if (HasConnectedInput(0)) { // retrieve input string from input var node = InPorts[0].Connectors[0].Start.Owner; var nodeIndex = InPorts[0].Connectors[0].Start.Index; var nodeName = node.GetAstIdentifierForOutputIndex(nodeIndex).Name; var mirrorData = engine.GetMirror(nodeName); D3jsLib.Report report = mirrorData.GetData().Data as D3jsLib.Report; htmlString = report.HtmlString; } else { htmlString = string.Empty; } return(htmlString); }
//public Transform testobj; void Start() { EngineControl = DFUNC_AAMControl.EngineControl; MissileRigid = GetComponent <Rigidbody>(); AAMCollider = GetComponent <CapsuleCollider>(); if (EngineControl.AAMTargets[DFUNC_AAMControl.AAMTarget] != null) { Target = EngineControl.AAMTargets[DFUNC_AAMControl.AAMTarget].transform; } if (Target == null) { TargetLost = true; Debug.LogWarning("AAM spawned without target"); } else { TargDistlastframe = Vector3.Distance(transform.position, Target.position) + 1; //1 meter further so the number is different and missile knows we're already moving toward target TargetPosLastFrame = Target.position - Target.forward; //assume enemy plane was 1 meter behind where it is now last frame because we don't know the truth if (EngineControl.AAMTargets[DFUNC_AAMControl.AAMTarget].transform.parent != null) { TargetEngineControl = EngineControl.AAMTargets[DFUNC_AAMControl.AAMTarget].transform.parent.GetComponent <EngineController>(); if (TargetEngineControl != null) { if (TargetEngineControl.Piloting || TargetEngineControl.Passenger) { TargetEngineControl.MissilesIncoming++; } MissileIncoming = true; TargetIsPlane = true; } } if (EngineControl.InEditor || EngineControl.IsOwner) { Owner = true; LockHack = false; } } }
/// <summary> /// Saves custom node workspace /// </summary> /// <param name="newPath">New location to save the workspace.</param> /// <param name="isBackup">Indicates whether saved workspace is backup or not. If it's not backup, /// we should add it to recent files. Otherwise leave it.</param> /// <param name="engine"></param> /// <returns></returns> public override void Save(string newPath, bool isBackup = false, EngineController engine = null) { var originalPath = FileName; // A SaveAs to an existing function id prompts the creation of a new // custom node with a new function id if (originalPath != newPath) { FileName = newPath; // If it is a newly created node, no need to generate a new guid if (!string.IsNullOrEmpty(originalPath)) { CustomNodeId = Guid.NewGuid(); } // This comes after updating the Id, as if to associate the new name // with the new Id. SetInfo(Path.GetFileNameWithoutExtension(newPath)); } base.Save(newPath, isBackup, engine); }
/// <summary> /// Call this method to reset the virtual machine, avoiding a race /// condition by using a thread join inside the vm executive. /// TODO(Luke): Push this into a resync call with the engine controller /// </summary> /// <param name="controller"></param> /// <param name="markNodesAsDirty">Set this parameter to true to force /// reset of the execution substrait. Note that setting this parameter /// to true will have a negative performance impact.</param> public void ResetEngine(EngineController controller, bool markNodesAsDirty = false) { if (EngineController != null) { EngineController.MessageLogged -= Log; EngineController.LibraryServices.LibraryLoaded -= LibraryLoaded; } EngineController = controller; controller.MessageLogged += Log; controller.LibraryServices.LibraryLoaded += LibraryLoaded; if (markNodesAsDirty) { // Mark all nodes as dirty so that AST for the whole graph will be // regenerated. MarkNodesAsModifiedAndRequestRun(Nodes); } if (RunSettings.RunType == RunType.Automatic) Run(); }
internal bool Initialize(UpdateRenderPackageParams initParams) { if (initParams == null) { throw new ArgumentNullException("initParams"); } if (initParams.Node == null) { throw new ArgumentNullException("initParams.Node"); } if (initParams.EngineController == null) { throw new ArgumentNullException("initParams.EngineController"); } if (initParams.DrawableIds == null) { throw new ArgumentNullException("initParams.DrawableIds"); } var nodeModel = initParams.Node; if (!nodeModel.IsUpdated && (!nodeModel.RequiresRecalc)) { return(false); // Not has not been updated at all. } drawableIds = initParams.DrawableIds; if (!drawableIds.Any()) { return(false); // Nothing to be drawn. } displayLabels = nodeModel.DisplayLabels; isNodeSelected = nodeModel.IsSelected; maxTesselationDivisions = initParams.MaxTesselationDivisions; engineController = initParams.EngineController; previewIdentifierName = initParams.PreviewIdentifierName; nodeGuid = nodeModel.GUID; return(true); }
public MainWindowViewmodel() { if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject())) { try { EngineController.Initialize(); var engines = EngineController.Engines; _channels = new List <ChannelViewmodel>(engines.Select(engine => new ChannelViewmodel(engine, true, true, true))); } catch (TypeInitializationException e) { MessageBox.Show(string.Format(resources._message_CantInitializeEngines, e.InnerException), resources._caption_Error, MessageBoxButton.OK, MessageBoxImage.Error); Application.Current.Shutdown(1); } catch (Exception e) { MessageBox.Show(string.Format(resources._message_CantInitializeEngines, e), resources._caption_Error, MessageBoxButton.OK, MessageBoxImage.Error); Application.Current.Shutdown(1); } } }
public HomeWorkspaceModel( EngineController engine, DynamoScheduler scheduler, NodeFactory factory, IEnumerable <KeyValuePair <Guid, List <string> > > traceData, IEnumerable <NodeModel> e, IEnumerable <NoteModel> n, WorkspaceInfo info, bool verboseLogging, bool isTestMode) : base(e, n, info, factory) { EvaluationCount = 0; RunSettings = new RunSettings(info.RunType, info.RunPeriod); PreloadedTraceData = traceData; this.scheduler = scheduler; this.verboseLogging = verboseLogging; IsTestMode = isTestMode; EngineController = engine; }
protected override void Initialize() { debugDrawTimeStopwatch = new Stopwatch(); // Window.IsBorderless = false; Data.SetSettings(); ScreenController.graphicsDevice = GraphicsDevice; DisplayController.Init(this); EngineController.Init(); GraphicsManager.Init(Content); AudioManager.Init(Content); //Game specific init. this could probably be done in game load GroundLayerController.Init(); AngleStuff.Init(); PieceController.Init(); ShadowSpriteController.Init(); MapObjectController.Init(); TileLogisticsController.Init(); GraphicsDevice.Clear(Color.White); IsMouseVisible = true; base.Initialize(); ScreenController.ChangeScreen(new MenuMain()); }
public WorkspaceComparisonData(WorkspaceModel workspace, EngineController controller) { Guid = workspace.Guid; Description = workspace.Description; NodeCount = workspace.Nodes.Count(); ConnectorCount = workspace.Connectors.Count(); NodeTypeMap = new Dictionary <Guid, Type>(); NodeDataMap = new Dictionary <Guid, List <object> >(); InportCountMap = new Dictionary <Guid, int>(); OutportCountMap = new Dictionary <Guid, int>(); foreach (var n in workspace.Nodes) { NodeTypeMap.Add(n.GUID, n.GetType()); var portvalues = n.OutPorts.Select(p => GetDataOfValue(n.GetValue(p.Index, controller))).ToList <object>(); NodeDataMap.Add(n.GUID, portvalues); InportCountMap.Add(n.GUID, n.InPorts.Count); OutportCountMap.Add(n.GUID, n.OutPorts.Count); } }
public run_command_integration_specs() { TestUtility.CleanUpHangingProcesses(); var directory = TestingContext.FindParallelDirectory("Storyteller.Samples"); var project = Project.LoadForFolder(directory); #if NET46 theController = new EngineController(project, new AppDomainSystemLauncher(project)); #else theController = new EngineController(project, new ProcessRunnerSystemLauncher(project)); #endif theInput = new RunInput { Path = directory, RetriesFlag = 1 }; theController = theInput.BuildEngine(); var task = theController.Start(); task.Wait(3.Seconds()); theFixtures = task.Result.fixtures; }
public void InstantiateShop() { Item[] shopItems = GameObject.Find("Game Engine").GetComponent <EngineController>().shopItems; for (int x = 0; x < 3; x++) { ShopButtonController controller = shopButtons[x].GetComponent <ShopButtonController>(); controller.buttonManager = this; controller.item = shopItems[x]; if (controller.item != null) { switch (controller.item.slot) { case Item.Slot.Sword: shopButtons[x].transform.GetChild(1).GetComponent <Image>().sprite = sword; break; case Item.Slot.Head: shopButtons[x].transform.GetChild(1).GetComponent <Image>().sprite = head; break; case Item.Slot.Chest: shopButtons[x].transform.GetChild(1).GetComponent <Image>().sprite = chest; break; case Item.Slot.Feet: shopButtons[x].transform.GetChild(1).GetComponent <Image>().sprite = feet; break; } } EngineController engine = GameObject.Find("Game Engine").GetComponent <EngineController>(); if (engine.shopItemBought[x] == true || !GameObject.Find("Game Engine").GetComponent <EngineController>().shopUnlocked) { shopButtons[x].SetActive(false); } } }
/// <summary> /// Save a Workspace to json. /// </summary> /// <returns>A string representing the serialized WorkspaceModel.</returns> internal static string ToJson(this WorkspaceModel workspace, EngineController engine) { var settings = new JsonSerializerSettings { Error = (sender, args) => { args.ErrorContext.Handled = true; Console.WriteLine(args.ErrorContext.Error); }, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, TypeNameHandling = TypeNameHandling.Auto, Formatting = Formatting.Indented, Converters = new List <JsonConverter> { new ConnectorConverter(), new WorkspaceWriteConverter(engine) }, ReferenceResolverProvider = () => { return(new IdReferenceResolver()); } }; var json = JsonConvert.SerializeObject(workspace, settings); var result = ReplaceTypeDeclarations(json); return(result); }
private void Start() { this.controller = Resources.FindObjectsOfTypeAll <EngineController>()[0]; this.controller.gameObject.SetActive(false); gestureRecognizer = new GestureRecognizer(); gestureRecognizer.SetRecognizableGestures(GestureSettings.Tap); gestureRecognizer.TappedEvent += GestureRecognizer_TappedEvent; gestureRecognizer.StartCapturingGestures(); var keywords = new Dictionary <string, Action>(); keywords.Add("Switch View", () => this.controller.FlipHoloView()); keywords.Add("Switch State", () => this.controller.FlipExplosionStage()); this.keywordRecongizer = new KeywordRecognizer(keywords.Keys.ToArray()); this.keywordRecongizer.OnPhraseRecognized += (PhraseRecognizedEventArgs args) => { Action action; if (keywords.TryGetValue(args.text, out action)) { action(); } }; this.keywordRecongizer.Start(); }
public ColorRange1D ComputeColorRange(EngineController engine) { List <Color> colors; List <double> parameters; // If there are colors supplied if (InPorts[0].IsConnected) { var colorsNode = InPorts[0].Connectors[0].Start.Owner; var colorsIndex = InPorts[0].Connectors[0].Start.Index; var startId = colorsNode.GetAstIdentifierForOutputIndex(colorsIndex).Name; var colorsMirror = engine.GetMirror(startId); colors = GetColorsFromMirrorData(colorsMirror); } else { colors = new List <Color>(); colors.AddRange(DefaultColorRanges.Analysis); } // If there are indices supplied if (InPorts[1].IsConnected) { var valuesNode = InPorts[1].Connectors[0].Start.Owner; var valuesIndex = InPorts[1].Connectors[0].Start.Index; var endId = valuesNode.GetAstIdentifierForOutputIndex(valuesIndex).Name; var valuesMirror = engine.GetMirror(endId); parameters = GetValuesFromMirrorData(valuesMirror); } else { parameters = CreateParametersForColors(colors); } return(ColorRange1D.ByColorsAndParameters(colors, parameters)); }
public override void Initialize() { this.LogService = new LogService(); this.DataMaintainer = new DataMaintainer.DataMaintainer(); this.EngineController = new EngineHandle(); this.SequenceManager = new SequenceManager.SequenceManager(); this.ComInterfaceManager = new InterfaceManager(); ModuleConfigData configData = new ModuleConfigData(); configData.InitExtendProperties(); LogService.ApplyConfig(configData); ComInterfaceManager.ApplyConfig(configData); SequenceManager.ApplyConfig(configData); DataMaintainer.ApplyConfig(configData); EngineController.ApplyConfig(configData); LogService.RuntimeInitialize(); ComInterfaceManager.DesigntimeInitialize(); SequenceManager.DesigntimeInitialize(); DataMaintainer.RuntimeInitialize(); EngineController.RuntimeInitialize(); }
public override void Initialize (EngineController controller) { base.Initialize (controller); controller.BuildingMethodBody += new EventHandler<EngineEventArgs> (OnMethodBody); }
public EngineController BuildEngine() { var project = configureProject(); #if NET46 var launcher = project.UseSeparateAppDomain ? new AppDomainSystemLauncher(project) : (ISystemLauncher) new ProcessRunnerSystemLauncher(project); var controller = new EngineController(project, launcher); #else var controller = new EngineController(project, new ProcessRunnerSystemLauncher(project)); #endif controller.DisableAppDomainFileWatching = _disableAppDomainFileWatching; return controller; }
void Start() { engine = gameObject.GetComponent<Engine>(); engineController = gameObject.GetComponent<EngineController>(); }
private SpecificationEngine buildUserInterfaceEngine() { var observer = new UserInterfaceObserver(); var runner = new SpecRunner(new UserInterfaceExecutionMode(observer), _system, _specExpiration); var executionObserver = new UserInterfaceExecutionObserver(); var engine = new SpecificationEngine(_system, runner, executionObserver); _controller = new EngineController(engine, observer, runner); // Super hokey, but we need some way to feed the spec started // event up to EngineController // TODO -- maybe pull the IExecutionQueue concept from 1-2 back out executionObserver.Controller = (EngineController) _controller; _services.Add(observer); _services.Add(engine); EventAggregator.Messaging.AddListener(_controller); return engine; }
public EngineEventArgs (EngineController controller) { Controller = controller; }
/// <summary> /// Note: TearDown can be called without a call to Engine.Register or /// Engine.Initialize /// </summary> public virtual void TearDown () { controller = null; }
/// <summary> /// Override to attach to some of the controller events /// </summary> /// <param name="controller"></param> public virtual void Initialize (EngineController controller) { this.controller = controller; }