Exemple #1
0
 void moveAroundOBJ(Transform objToMoveAround)
 {
     if (moveDir.Equals(MoveDirection.CounterClockwise))
     {
         //SpeedOfOrbit = SpeedOfOrbit * -1;
         transform.RotateAround(objToMoveAround.position, objToMoveAround.up, -SpeedOfOrbit * Time.deltaTime);
     }
     if (moveDir.Equals(MoveDirection.Clockwise))
     {
         //SpeedOfOrbit = SpeedOfOrbit * -1;
         transform.RotateAround(objToMoveAround.position, objToMoveAround.up, SpeedOfOrbit * Time.deltaTime);
     }
 }
        public EStatus MoveTile(Position kTilePosition, out MoveDirection kBlankTileMoveDirection)
        {
            Position kBlankTilePosition = CurrentBoard.BlankTilePosition;

            kBlankTileMoveDirection = GetBlankTileMoveDirection(kBlankTilePosition, kTilePosition);
            if (kBlankTileMoveDirection.Equals(MoveDirection.None))
            {
                return(EStatus.FAILURE);
            }

            CurrentBoard   = CurrentBoard.Move(kBlankTileMoveDirection);
            BoardInputText = BoardToText(CurrentBoard);
            return(EStatus.SUCCESS);
        }
Exemple #3
0
    void Start()
    {
        if (target != null)
        {
            rigidbody = target.GetComponent <Rigidbody> ();
        }
        else
        {
            rigidbody = GetComponent <Rigidbody> ();
        }

        Vector3 dir = direction.Equals(MoveDirection.Right) ? transform.right : -transform.right;

        dir.Normalize();

        rigidbody.velocity = dir * speed;
    }
        // GET: /Workflow/
        public ActionResult Display(int id)
        {
            //DataObjectLoader DOL = new API.ExternalData.DataObjectLoader();
            WorkflowDisplay wfDisplay = new WorkflowDisplay();

            WFNodeInfo nextNode = null;

            ScreenViewer.API.WorkflowController WFC = new API.WorkflowController();
            var actionResult      = WFC.GetScriptWorkflow(id);
            DataObjectManager DOM = new DataObjectManager();

            if (actionResult != null)
            {
                var response = actionResult as OkNegotiatedContentResult <ScriptWorkflow>;
                ViewBag.WorkflowName   = response.Content.WorkflowName;
                wfDisplay.workflowName = response.Content.WorkflowName;

                nextNode = DetermineNextNode((ScriptWorkflow)response.Content, currentNode, direction);

                if (nextNode != null)
                {
                    if (!direction.Equals(MoveDirection.Current) && nextNode.nodeName != null && nextNode.nodeType.Equals(NodeType.Section))
                    {
                        SessionManager.StoreNavigation(HttpContext.Session, nextNode.nodeName, wfDisplay.workflowName.ToString());
                    }

                    if (nextNode.nodeActions != "") //&& fireactions
                    {
                        FireActions(nextNode.nodeActions);
                    }

                    switch (nextNode.nodeType)
                    {
                    case NodeType.Section:
                        AddtoWFHistory(response.Content.ScriptWorkflowID, nextNode.NodeUniqueID, response.Content.WorkflowName, nextNode.nodeName);
                        break;

                    case NodeType.Workflow:
                        return(RedirectToAction("Display", "Workflow", new { id = WFC.GetScriptWorkflowId(nextNode.nodeName) }));

                    case NodeType.PreviousWorkflow:
                        return(RedirectToAction("DisplayByDirection", "Workflow", new { id = WFC.GetScriptWorkflowId(nextNode.nodeName), currentNode = nextNode.DocUID, moveDirection = MoveDirection.Current }));

                    case NodeType.SignPost:
                        MoveDirection direction2 = direction == MoveDirection.Start ? MoveDirection.Forward : direction;
                        WFNodeInfo    holdNode   = nextNode;
                        nextNode = DetermineNextNode((ScriptWorkflow)response.Content, nextNode.NodeUniqueID, direction2);
                        if (nextNode == null)
                        {
                            direction = MoveDirection.Current;
                            return(Display(Convert.ToInt32(Request.Form["hdnWorkflowId"])));
                            //nextNode = holdNode;
                        }
                        else
                        {
                            if (!direction.Equals(MoveDirection.Current) && nextNode.nodeName != null)
                            {
                                SessionManager.StoreNavigation(HttpContext.Session, nextNode.nodeName, wfDisplay.workflowName.ToString());
                                AddtoWFHistory(response.Content.ScriptWorkflowID, nextNode.NodeUniqueID, response.Content.WorkflowName, nextNode.nodeName);
                            }

                            if (nextNode.nodeType.Equals(NodeType.Workflow))
                            {
                                return(RedirectToAction("Display", "Workflow", new { id = WFC.GetScriptWorkflowId(nextNode.nodeName) }));
                            }
                        }
                        FireActions(nextNode.nodeActions);
                        if (nextNode.nodeType.Equals(NodeType.SignPost))
                        {
                            nextNode = DetermineNextNode((ScriptWorkflow)response.Content, nextNode.NodeUniqueID, direction2);

                            if (nextNode == null)
                            {
                                direction = MoveDirection.Current;
                                return(Display(Convert.ToInt32(Request.Form["hdnWorkflowId"])));
                                //nextNode = holdNode;
                            }
                            else
                            {
                                if (!direction.Equals(MoveDirection.Current) && nextNode.nodeName != null)
                                {
                                    SessionManager.StoreNavigation(HttpContext.Session, nextNode.nodeName, wfDisplay.workflowName.ToString());
                                    AddtoWFHistory(response.Content.ScriptWorkflowID, nextNode.NodeUniqueID, response.Content.WorkflowName, nextNode.nodeName);
                                }

                                if (nextNode.nodeType.Equals(NodeType.Workflow))
                                {
                                    return(RedirectToAction("Display", "Workflow", new { id = WFC.GetScriptWorkflowId(nextNode.nodeName) }));
                                }
                            }
                            FireActions(nextNode.nodeActions);
                        }
                        break;
                    }

                    if (IsNextNode((ScriptWorkflow)response.Content, nextNode.NodeUniqueID))
                    {
                        wfDisplay.showNext = true;
                    }
                    else
                    {
                        wfDisplay.showNext = false;
                    }
                }
                else
                {
                    direction = MoveDirection.Current;
                    return(Display(Convert.ToInt32(Request.Form["hdnWorkflowId"])));
                }
            }

            if (AddHistory)
            {
                if (SessionManager.GetWorkflowHistory(HttpContext.Session).Length >= 2)
                {
                    wfDisplay.showPrevious = true;
                }
                else
                {
                    wfDisplay.showPrevious = false;
                }
            }
            Session["layout"]    = null;
            wfDisplay.nextNode   = nextNode;
            wfDisplay.workflowID = id.ToString();
            nextNode.DocUID      = id;
            SessionManager.StoreNextNode(HttpContext.Session, nextNode);
            wfDisplay.callNotes = SessionManager.GetContactNotes(HttpContext.Session);

            string layoutname = "_default";

            if (!string.IsNullOrEmpty(SessionManager.GetScreenLayout(HttpContext.Session)))
            {
                layoutname = SessionManager.GetScreenLayout(HttpContext.Session);
            }

            WorkflowLayoutsController WLC = new WorkflowLayoutsController();

            //var actionResult2 = WLC.GetWorkflowLayoutString(layoutname, ScreenViewer.ClientHelper.GetClientIdByUserID(System.Web.HttpContext.Current.User.Identity.GetUserId()));
            var actionResult2 = WLC.GetWorkflowLayoutString(layoutname, SessionManager.GetScriptParameterByKey("ClientId", HttpContext.Session));

            if (actionResult2 != null)
            {
                var response = actionResult2 as OkNegotiatedContentResult <string>;
                wfDisplay.Layout = response.Content;
            }
            ScriptProject scriptproject = null;

            API.ProjectController PC = new API.ProjectController();
            var actionResult3        = PC.GetScriptProject(SessionManager.GetProjectId(HttpContext.Session));

            if (actionResult3 != null)
            {
                var response = actionResult3 as OkNegotiatedContentResult <ScriptProject>;
                scriptproject = response.Content;
            }

            string notif = scriptproject.NotificationText;

            wfDisplay.menuHTML = SessionManager.GetMenuHTML(HttpContext.Session);

            wfDisplay.Notifications = scriptproject.NotificationText; //notif.Replace(System.Environment.NewLine,"");

            return(View("_WorkFlowViewLayout1", wfDisplay));
        }
 private void SpriteRotaions(GameTime gameTime, MoveDirection direction)
 {
     foreach (MoveDirection direct in this.directionToFrames.Keys.Where(key => direction.Equals(key)))
     {
         if (this.directionToFrames[direct].Contains(this.CurrentFrame))
         {
             this.CurrentFrame++;
             if (this.CurrentFrame == this.directionToFrames[direct][2] + 1)
             {
                 this.CurrentFrame = this.directionToFrames[direct][0];
             }
         }
         else
         {
             this.CurrentFrame = this.directionToFrames[direct][0];
         }
     }
 }
Exemple #6
0
 private void SpriteRotaions(GameTime gameTime, MoveDirection direction)
 {
     foreach (MoveDirection direct in this.directionToFrames.Keys.Where(key => direction.Equals(key)))
     {
         if (this.directionToFrames[direct].Contains(this.CurrentFrame))
         {
             this.CurrentFrame++;
             if (this.CurrentFrame == this.directionToFrames[direct][2] + 1)
             {
                 this.CurrentFrame = this.directionToFrames[direct][0];
             }
         }
         else
         {
             this.CurrentFrame = this.directionToFrames[direct][0];
         }
     }
 }