public void SetCanvasOrder()
    {
        if (ActiveBranch.IsNull() || _myCanvas.sortingOrder > _startingOrder)
        {
            return;
        }

        switch (GetOrderInCanvas)
        {
        case OrderInCanvas.InFront:
            _myCanvas.sortingOrder++;
            break;

        case OrderInCanvas.Behind:
            _myCanvas.sortingOrder--;
            break;

        case OrderInCanvas.Manual:
            if (ActiveBranch.CanvasOrder == GetOrderInCanvas)
            {
                _myCanvas.sortingOrder++;
            }
            break;
        }
    }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GXGridView1.TotalRecords = ActiveBranch.SelectCountCached();
         mvMain.SetActiveView(viewGrid);
         reportControl.BranchName  = BrokerHouseInformation.GetBrokerHouseNameByCode(BrokerHouseInformation.FIRST_ROW);
         reportControl.CompanyName = "Брокерско друштво";
     }
 }
Esempio n. 3
0
 private void SwitchGroupPressed(ISwitchGroupPressed args)
 {
     if (!OnHomeScreen && ActiveBranch.IsInternalBranch())
     {
         BackOneLevel();
     }
     else
     {
         ClearAllHistory();
     }
 }
Esempio n. 4
0
 protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInEditMode   = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = ActiveBranch.SelectCountCached();
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }
Esempio n. 5
0
    //Main
    private void StartPopUp(IPausePressed args)
    {
        if (!CanStart)
        {
            return;
        }

        if (!GameIsPaused)
        {
            PauseGame();
            return;
        }

        if (GameIsPaused && ActiveBranch.IsPauseMenuBranch())
        {
            UnPauseGame();
        }
    }
Esempio n. 6
0
        public void Invoke(Npc a)
        {
            if (ActiveBranch == null)
            {
                return;
            }

            // Root methods which should be invoked each time
            UpdateTimers();
            UpdateDistances(a);
            UpdateAnimInfo(a, 0);

            if (!RootChecks(a))
            {
                return;
            }

            // Root methods which should be invoked on a timer
            if (TimerRoot >= a.Params.ChkAlert)
            {
                UpdateSeeTarget(a);
                TimerRoot = 0.0f;
            }

            // What should we do if the active behavior branch succeeds or fails
            if (ActiveBranch.Invoke(a, this) != BhvStatus.RUNNING)
            {
                // If we were fleeing but we successfully escaped
                if (ActiveBranch == BNpcFlee.Instance && Status == BhvStatus.SUCCESS)
                {
                    // Replenish stats
                    a.Stats.AddHealth(a.Stats.HealthMax - a.Stats.Health);
                    a.Stats.AddArmor(a.Stats.ArmorMax - a.Stats.Armor);
                    a.Stats.AddStamina(a.Stats.StaminaMax - a.Stats.Stamina);
                }

                // Unable to reach target, pathfinding failed
                if (PathFailed)
                {
                    // Debug.Log( "Pathfinding failed, fleeing..." );
                    ChangeBranch(BNpcFlee.Instance, a);
                    return;
                }

                if (a.Stats.Wounded)
                {
                    if (a.TargetObj == null || !SeeTarget)
                    {
                        ChangeBranch(BNpcFlee.Instance, a);
                        return;
                    }
                    else
                    {
                        if (DistTarget > Util.GetSquare(a.Params.AtkDist))
                        {
                            if (!a.Params.Territorial && (!a.Params.Predator || a.Params.Flighty))
                            {
                                ChangeBranch(BNpcFlee.Instance, a);
                            }
                            else
                            {
                                ChangeBranch(BNpcAggro.Instance, a);
                            }
                        }
                        else
                        {
                            // Only attack live entities
                            if (a.TargetEnt != null)
                            {
                                ChangeBranch(BNpcAtk.Instance, a);
                            }
                        }

                        return;
                    }
                }

                if (a.TargetObj == null || !SeeTarget)
                {
                    // If we have a destination
                    if (a.MovePos != Vector3.zero)
                    {
                        ChangeBranch(BNpcMoving.Instance, a);
                    }
                    else
                    {
                        ChangeBranch(BNpcIdle.Instance, a);
                    }
                }
                else                 // If the parent NPC has a target (that can be seen); we're not in idletown anymore
                {
                    // Check how close the Npc is
                    if (DistTarget > Util.GetSquare(a.Params.AwareMed) && Patient) // If target is further than the medium awareness distance and Npc is still patient
                    {
                        ChangeBranch(BNpcAlert.Instance, a);                       // We become alert
                    }
                    else if (DistTarget > Util.GetSquare(a.Params.AwareClose))     // If target is nearer than the medium distance but further than the close distance
                    {
                        if (a.Params.Predator || a.Params.Territorial)             // If we're a predatory Npc or territorial...
                        {
                            ChangeBranch(BNpcHunt.Instance, a);                    // ... we go hunting
                        }
                        else                                                       // Otherwise...
                        {
                            ChangeBranch(BNpcWary.Instance, a);                    // ... we become wary
                        }
                    }
                    else if (DistTarget > Util.GetSquare(a.Params.AtkDist)) // If target is too close for comfort
                    {
                        if (a.Params.Predator || a.Params.Territorial)      // If we're a predatory Npc...
                        {
                            ChangeBranch(BNpcAggro.Instance, a);            // ... we get angry
                        }
                        else                                                // Otherwise...
                        {
                            ChangeBranch(BNpcFlee.Instance, a);             // ... we run away
                        }
                    }
                    else                        // And then the fight started
                    {
                        // Only attack live entities
                        if (a.TargetEnt != null)
                        {
                            ChangeBranch(BNpcAtk.Instance, a);
                        }
                    }
                }
            }
        }
Esempio n. 7
0
 private bool CanUnpauseGame() => GameIsPaused && ActiveBranch.IsPauseMenuBranch();
Esempio n. 8
0
 protected void SearchControl1_Search(object sender, EventArgs e)
 {
     GXGridView1.TotalRecords = ActiveBranch.SelectSearchCountCached(SearchControl1.SearchArguments);
     mvMain.SetActiveView(viewGrid);
 }
Esempio n. 9
0
 protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e)
 {
     GXGridView1.TotalRecords = ActiveBranch.SelectCountCached();
     GXGridView1.DataBind();
     mvMain.SetActiveView(viewGrid);
 }
Esempio n. 10
0
 protected void FilterControl1_Filter(object sender, EventArgs e)
 {
     GXGridView1.TotalRecords = ActiveBranch.SelectFilterCountCached(FilterControl1.FCFilterArgument);
 }