Пример #1
0
        private void SetControls(int index)
        {
            EnableAllControls();
            switch (index)
            {
            case 0:
                SetBookView();
                addPosition    = AddBook;
                editPosition   = EditBook;
                searchPosition = SearchBook;
                break;

            case 1:
                SetGameView();
                addPosition    = AddGame;
                editPosition   = EditGame;
                searchPosition = SearchGame;
                break;

            case 2:
                SetMagazineView();
                addPosition    = AddMagazineNumber;
                editPosition   = EditMagazineNumber;
                searchPosition = SearchMagazineNumber;
                break;
            }
        }
        /// <summary>
        /// Adds an item to this collection.
        /// </summary>
        /// <param name="item">Item to add.</param>
        /// <param name="position">Position in list to insert item.</param>
        public void AddItem(DaggerfallUnityItem item, AddPosition position = AddPosition.Back)
        {
            if (item == null)
                return;

            // Add the item based on stack behaviour
            // TODO: Look at implementing proper stacking with max limits, split, merge, etc.
            DaggerfallUnityItem stack = FindExistingStack(item);
            if (stack != null)
            {
                // Add to stack count
                stack.stackCount += item.stackCount;
            }
            else
            {
                // Check duplicate key
                if (items.Contains(item.UID))
                    throw new Exception("AddItem() encountered a duplicate item UID for " + item.LongName);

                // Add the item
                switch (position)
                {
                    case AddPosition.DontCare:
                        items.Add(item.UID, item);
                        break;
                    case AddPosition.Front:
                        items.Insert(0, item.UID, item);
                        break;
                    case AddPosition.Back:
                        items.Insert(Count, item.UID, item);
                        break;
                }
            }
        }
Пример #3
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
//        Debug.Log("Return to ball pos relative system going");
        // if (!Mathf.Approximately(PlayTimeSettings.returnToGroupPosRelative, 0))
        {
            float returnStrength;
            if (!Mathf.Approximately(PlayTimeSettings.returnToGroupPosRelativeFast, 0))
            {
                returnStrength = PlayTimeSettings.returnToGroupPosRelativeFast;
            }
            else
            {
                returnStrength = PlayTimeSettings.returnToGroupPosRelative;
            }
            var job = new AddPosition {
                returnToRelPosStrength = returnStrength
            };
            return(job.Schedule(this, inputDeps));
        }
        //else
        //{
        //    Debug.Log("NOTHIN FROM WHIRL");
        //    var job = new NothingJob { };
        //    return job.Schedule(this, inputDeps);
        //}
    }
Пример #4
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new AddPosition {
            implodeStrength = PlayTimeSettings.getGroupImplodeStrength()
        };

        return(job.Schedule(this, inputDeps));
    }
Пример #5
0
        public AddPositionViewModel(AddPosition addPosition)
        {
            view = addPosition;


            positionService = new PositionService();

            Position = new tblPosition();
        }
Пример #6
0
        private void BtnAddPosition_Click(object sender, RoutedEventArgs e)
        {
            AddPosition addPosition = new AddPosition();

            this.Opacity = 0.3;
            Filter();
            addPosition.ShowDialog();
            Filter();
            this.Opacity = 1;
        }
        /// <summary>
        /// Transfers a single item from another collection to this collection.
        /// Item will be removed from source collection and placed in this collection.
        /// UID will be retained.
        /// </summary>
        /// <param name="item">Item to transfer.</param>
        /// <param name="source">Source collection to transfer from.</param>
        /// <param name="position">Position in list to transfer item.</param>
        public void Transfer(DaggerfallUnityItem item, ItemCollection source, AddPosition position = AddPosition.DontCare)
        {
            if (item == null || source == null)
            {
                return;
            }

            source.RemoveItem(item);
            AddItem(item, position);
        }
        /// <summary>
        /// Reorders item in collection.
        /// </summary>
        /// <param name="item">Item to reorder. Must exist inside this collection.</param>
        /// <param name="position">Position to reorder to.</param>
        public void ReorderItem(DaggerfallUnityItem item, AddPosition position)
        {
            if (!items.Contains(item.UID) || position == AddPosition.DontCare)
            {
                return;
            }

            RemoveItem(item);
            AddItem(item, position);
        }
 private void AddPositionExecute()
 {
     try
     {
         AddPosition addPosition = new AddPosition();
         addPosition.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 private void AddPositionExecute()
 {
     try
     {
         AddPosition addPosition = new AddPosition();
         addPosition.ShowDialog();
         //PositionList = positionService.GetPositions();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Пример #11
0
        /// <summary>
        /// Reorders item in collection.
        /// </summary>
        /// <param name="item">Item to reorder. Must exist inside this collection.</param>
        /// <param name="position">Position to reorder to.</param>
        public void ReorderItem(DaggerfallUnityItem item, AddPosition position)
        {
            if (!items.Contains(item.UID))
            {
                return;
            }
            bool couldBeStacked = FindExistingStack(item) != null;

            if (position == AddPosition.DontCare && !couldBeStacked)
            {
                return;
            }

            RemoveItem(item);
            AddItem(item, position);
        }
Пример #12
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        // if (!Mathf.Approximately(PlayTimeSettings.whirlStrength, 0))
        // {
        var job = new AddPosition
        {
            firstBallInGroupCurrentPos          = BallShooter.firstBallOfLastEntityGroupCurrentPos,
            firstBallInGroupOriginalRelativePos = BallShooter.firstBallOfLastEntityGroupOriginalRelativePos,
            whirlStrength = PlayTimeSettings.whirlStrength
        };

        return(job.Schedule(this, inputDeps));
        //}
        //else
        //{
        //    var job = new NothingJob { };
        //    return job.Schedule(this, inputDeps);
        //}
    }
Пример #13
0
        /// <summary>
        /// Adds an item to this collection.
        /// </summary>
        /// <param name="item">Item to add.</param>
        /// <param name="position">Position in list to insert item.</param>
        public void AddItem(DaggerfallUnityItem item, AddPosition position = AddPosition.Back, bool noStack = false)
        {
            if (item == null)
            {
                return;
            }

            // Add the item based on stack behaviour
            // TODO: Look at implementing proper stacking with max limits, split, merge, etc.
            DaggerfallUnityItem stack = FindExistingStack(item);

            if (stack != null && !noStack)
            {
                // Add to stack count
                stack.stackCount += item.stackCount;
            }
            else
            {
                // Log and exit if duplicate key found
                if (items.Contains(item.UID))
                {
                    UnityEngine.Debug.LogError("AddItem() encountered a duplicate item UID for " + item.LongName);
                    return;
                }

                // Add the item
                switch (position)
                {
                case AddPosition.DontCare:
                    items.Add(item.UID, item);
                    break;

                case AddPosition.Front:
                    items.Insert(0, item.UID, item);
                    break;

                case AddPosition.Back:
                    items.Insert(Count, item.UID, item);
                    break;
                }
            }
        }
Пример #14
0
        /// <summary>
        /// Adds an item to this collection.
        /// </summary>
        /// <param name="item">Item to add.</param>
        /// <param name="position">Position in list to insert item.</param>
        public void AddItem(DaggerfallUnityItem item, AddPosition position = AddPosition.Back)
        {
            if (item == null)
            {
                return;
            }

            // Add the item based on stack behaviour
            // Stacking currently only works for ingredients
            // TODO: Look at implementing proper stacking with max limits, split, merge, etc.
            DaggerfallUnityItem ingredient = FindIngredient(item);

            if (ingredient != null)
            {
                // Add to stack count
                ingredient.stackCount++;
            }
            else
            {
                // Check duplicate key
                if (items.Contains(item.UID))
                {
                    throw new Exception("AddItem() encountered a duplicate item UID for " + item.LongName);
                }

                // Add the item
                switch (position)
                {
                case AddPosition.DontCare:
                    items.Add(item.UID, item);
                    break;

                case AddPosition.Front:
                    items.Insert(0, item.UID, item);
                    break;

                case AddPosition.Back:
                    items.Insert(Count, item.UID, item);
                    break;
                }
            }
        }
Пример #15
0
        public void CreatePosition(Position position, Account loginUser)
        {
            AddPosition addPosition = new AddPosition(position, loginUser);

            addPosition.Excute();
        }
        /// <summary>
        /// Reorders item in collection.
        /// </summary>
        /// <param name="item">Item to reorder. Must exist inside this collection.</param>
        /// <param name="position">Position to reorder to.</param>
        public void ReorderItem(DaggerfallUnityItem item, AddPosition position)
        {
            if (!items.Contains(item.UID) || position == AddPosition.DontCare)
                return;

            RemoveItem(item);
            AddItem(item, position);
        }
Пример #17
0
 public AddPositionViewModel(AddPosition open)
 {
     addPosition = open;
     position    = new tblPosition();
 }
        /// <summary>
        /// Transfers a single item from another collection to this collection.
        /// Item will be removed from source collection and placed in this collection.
        /// UID will be retained.
        /// </summary>
        /// <param name="item">Item to transfer.</param>
        /// <param name="source">Source collection to transfer from.</param>
        /// <param name="position">Position in list to transfer item.</param>
        public void Transfer(DaggerfallUnityItem item, ItemCollection source, AddPosition position = AddPosition.DontCare)
        {
            if (item == null || source == null)
                return;

            source.RemoveItem(item);
            AddItem(item, position);
        }