Update() private method

private Update ( ) : void
return void
コード例 #1
0
ファイル: Game1.cs プロジェクト: HendrikMennen/Dash2D
        protected override void Update(GameTime gameTime)
        {
#if true
            level.getClientPlayer().EntityPacket = new EntityPacket(level.getClientPlayer()); //DIFFERENCE DETECTION
            float x = 0, y = 0;
            input.Update(this.IsActive, Mouse.GetState(), Keyboard.GetState(), GamePad.GetState(PlayerIndex.One));
            chat.update();
            mouseX = (int)input.MousePos.X;
            mouseY = (int)input.MousePos.Y;

            if (!chat.Open && !menu.Open)
            {
                if (input.KeyDown(Keys.LeftShift))
                {
                    level.getClientPlayer().speed = 2;
                }
                else
                {
                    level.getClientPlayer().speed = 1;
                }
                if (input.KeyDown(Keys.W))
                {
                    y -= level.getClientPlayer().speed;
                }
                if (input.KeyDown(Keys.A))
                {
                    x -= level.getClientPlayer().speed;
                }
                if (input.KeyDown(Keys.S))
                {
                    y += level.getClientPlayer().speed;
                }
                if (input.KeyDown(Keys.D))
                {
                    x += level.getClientPlayer().speed;
                }

                y += (int)Math.Round(input.CurrentGamepadState.ThumbSticks.Left.Y) * -1;
                x += (int)Math.Round(input.CurrentGamepadState.ThumbSticks.Left.X);

                if (input.KeyPressed(Keys.PageUp))
                {
                    time.CurrentTime += 0.1f;
                }
                if (input.KeyPressed(Keys.PageDown))
                {
                    time.CurrentTime -= 0.1f;
                }

                if (input.KeyPressed(Keys.T))
                {
                    chat.Open = true;
                }

                if (input.KeyPressed(Keys.L))
                {
                    if (playerlight)
                    {
                        playerlight = false;
                    }
                    else
                    {
                        playerlight = true;
                    }
                }
            }



            if (input.KeyPressed(Keys.F11))
            {
                if (graphics.IsFullScreen)
                {
                    graphics.IsFullScreen = false;
                    ChangeResolution(noFullscreenResolutionW, noFullscreenResolutionH);
                }
                else
                {
                    graphics.IsFullScreen   = true;
                    noFullscreenResolutionW = screenWidth;
                    noFullscreenResolutionH = screenHeight;
                    ChangeResolution(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);
                }
            }

            if (input.KeyPressed(Keys.Escape))
            {
                if (chat.Open)
                {
                    chat.Open = false;
                }
                if (menu.Open)
                {
                    menu.Open = false;
                }
                else
                {
                    menu.Open = true;
                }
            }

            switch (currentGamestate)
            {
            case GameState.Running:

                if (input.CurrentMouseState.ScrollWheelValue > input.PreviousMouseState.ScrollWheelValue && input.KeyDown(Keys.LeftControl))
                {
                    camera.AdjustZoom(0.2f);
                }
                if (input.CurrentMouseState.ScrollWheelValue < input.PreviousMouseState.ScrollWheelValue && input.KeyDown(Keys.LeftControl))
                {
                    camera.AdjustZoom(-0.2f);
                }
                level.getClientPlayer().Move(new Vector2(x, y));
                camera.CenterOn(new Vector2(level.getClientPlayer().Position.X + level.getClientPlayer().width / 2, level.getClientPlayer().Position.Y + level.getClientPlayer().height / 2), true);
                inv.Update(input);
                break;

            case GameState.Editor:

                editor.Update();
                if (editor.tilesetScroll)
                {
                    editor.moveTileset(new Vector2(x, y));
                }
                else
                {
                    camera.MoveCamera(new Vector2(x, y));
                }
                if (editor.currentEditorMode == MapEditor.EditorMode.EntityAdd)
                {
                    inv.Update(input);
                }
                break;

            case GameState.Pause:

                break;
            }

            level.update();

            effectmanager.Update(input);
            menu.update();
            hb.Update(gameTime);
            sound.update();
            NetCode.Update(); //After all movement !important
            input.UpdatePrev();
#endif
            base.Update(gameTime);
        }
コード例 #2
0
 void DumpInv()
 {
     File.Delete(datapath);
     state.Update();                           // вызов обновления state
     SerializatorInv.SaveXml(state, datapath); // и его сериализация
 }
コード例 #3
0
    protected override void Update()
    {
        if (!GameManager.gmInstance.playersTurn)
        {
            return;
        }


        updateUI();

        if (openInventory)
        {
            inventory.Update();
            if (inventory.getClosed())
            {
                inventory.setClosed(false);
                openInventory = false;
            }
            return;
        }

        if (openMap)
        {
            //mini.Update();
            if (mini.getClosed())
            {
                mini.setClosed(false);
                openMap = false;
            }
            return;
        }

        //reset code
        //GameObject.FindGameObjectWithTag("DunGen").GetComponent<MapGenerator>().Reset();


        if (Input.GetKeyDown("t"))
        {
            mini.buildMiniMap();
        }

        checkDead();

        base.Update();

        checkMoving();



        if (Input.GetButtonDown("Fire1"))
        {
            if (EventSystem.current.IsPointerOverGameObject())
            {
                Debug.Log("Clicked on the UI");
                return;
            }

            int clickRow = (int)GameManager.gmInstance.mRow;
            int clickCol = (int)GameManager.gmInstance.mCol;

            //attack or interact
            if (isAdjacent(clickRow, clickCol))
            {
                if (isFurniture(clickRow, clickCol))
                {
                    return;
                }
                else
                {
                    attackController(clickRow, clickCol);
                }
            }

            //move
            moveController(clickRow, clickCol);
        }
    }
コード例 #4
0
        public override void Update()
        {
            base.Update();

            if (SelectedLevel == -1)
            {
                // Delay after klick on level to entering it
                delay--;
                if (delay == 0)
                {
                    SelectedLevel     = levelToBeSelected;
                    levelToBeSelected = -1;
                    Levels[SelectedLevel].Initialize(ThePlayer);
                    numberOfJumps++;
                    bossLerpPosition += new Vector2(100, 0);
                }

                // Boss
                bossPosition = new Vector2(MathHelper.Lerp(bossPosition.X, bossLerpPosition.X, 0.01f), bossPosition.Y);
                bossAnimationTimer++;
                if (bossAnimationTimer > 5)
                {
                    bossAnimationTimer = 0;
                    if (bossAnimationFrame < 3)
                    {
                        bossAnimationFrame++;
                    }
                    else
                    {
                        bossAnimationFrame = 0;
                    }
                }

                // SpaceObjects
                foreach (GameObject spaceObject in SpaceObjects)
                {
                    spaceObject.Update();
                }

                for (int i = SpaceObjects.Count() - 1; i >= 0; i--)
                {
                    if (SpaceObjects[i].Dead)
                    {
                        SpaceObjects.RemoveAt(i);
                    }
                }

                if (!ThePlayer.Dead)
                {
                    NewItems.Update();
                    NewRank.Update();

                    // Boss
                    if (Globals.Distance(bossPosition, Levels[playerPosition].EnterLevel.Position) < 300 && delay < 0 && !Levels[Levels.Count() - 1].Complete)
                    {
                        levelToBeSelected = Levels.Count() - 1;
                        delay             = 65;
                    }

                    Inventory.Update();
                    if (Inventory.Press())
                    {
                        SceneManager.ChangeScene(SceneManager.inventoryScene);
                        NewItems.Flash = -1;
                    }

                    Menu.Update();
                    if (Menu.Press())
                    {
                        SceneManager.ChangeScene(SceneManager.menuScene);
                        SoundManager.ChangeMusic(SoundManager.menu);
                    }

                    Rank.Update();
                    if (Rank.Press())
                    {
                        SceneManager.ChangeScene(SceneManager.rankScene);
                        NewRank.Flash = -1;
                    }

                    MapInfo.Update();
                }
                else
                {
                    playerDeath--;
                    if (playerDeath == 30)
                    {
                        SoundManager.explosion.Play();
                    }
                    if (playerDeath == 0)
                    {
                        SceneManager.ChangeScene(SceneManager.gameOverScene);
                    }
                }

                for (int i = 0; i < Levels.Count() - 1; i++)
                {
                    Levels[i].UpdateMap();

                    if (!ThePlayer.Dead)
                    {
                        if (nearestLevels.Any(item => item == Levels[i]) && Levels[i].EnterLevel.Pressed() && delay < 0)
                        {
                            if (!Levels[i].Complete)
                            {
                                levelToBeSelected = i;
                                delay             = 65;
                            }
                            PlayerMove(i);
                        }
                    }
                }
            }
            else
            {
                Levels[SelectedLevel].Update();
            }
        }
コード例 #5
0
        /// <summary> ESSENTIALLY THE USER INPUT AND PHYSICS DETAILS
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            var kstate = Keyboard.GetState();
            HashSet <Sprite> groundObjectUpdateOrder = new HashSet <Sprite>();

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.F4))
            {
                Exit();
            }
            if (kstate.IsKeyDown(Keys.F12))
            {
                gameState.SaveGameState();
                Exit();
            }

            // game menu before everything
            if (startingMenu.showMenu)
            {
                startingMenu.Update(kstate, gameTime);
                return;
            }
            else if (startingMenu.selected == "new" && !gameState.ready)
            {
                gameState.CreateNewGame();
                return;
            }
            else if (startingMenu.selected == "load" && !gameState.ready)
            {
                gameState.LoadGameState();
                return;
            }


            // weather
            weather.Update(kstate, gameTime);
            // daylight shader
            dayLight.Update(kstate, gameTime);

            // static update (Menus)
            windArrows.Update(kstate, gameTime, null);
            int windDirection = windArrows.getWindDirection();
            int windSpeed     = windArrows.getWindSpeed();

            inventoryMenu.Update(kstate, gameTime, this.camera);
            craftingMenu.Update(kstate, gameTime, this.camera);

            Collidable.Clear();
            DrawOrder.Clear();

            // set any viewport visible(and not visible when in interior) collidable map pieces for collision - update LandTileLocList and GroundObjLocList
            BoundingBoxLocations.LandTileLocationList.Clear();
            BoundingBoxLocations.OceanTileLocationList.Clear();
            BoundingBoxLocations.GroundObjectLocationList.Clear();
            BoundingBoxLocations.TilesInView.Clear();
            Vector2 minCorner = new Vector2(camera.Position.X - (GameOptions.PrefferedBackBufferWidth / 2), camera.Position.Y - (GameOptions.PrefferedBackBufferHeight / 2));
            Vector2 maxCorner = new Vector2(camera.Position.X + (GameOptions.PrefferedBackBufferWidth / 2), camera.Position.Y + (GameOptions.PrefferedBackBufferHeight / 2));

            foreach (var tp in GameMapTiles.map)
            {
                if ((tp.location.X >= (minCorner.X - GameOptions.tileWidth) && tp.location.X <= (maxCorner.X + GameOptions.tileWidth)) &&
                    (tp.location.Y >= (minCorner.Y - GameOptions.tileHeight) && tp.location.Y <= (maxCorner.Y + GameOptions.tileHeight)))
                {
                    BoundingBoxLocations.TilesInView.Add(tp);

                    if (tp.bbKey.Equals("landTile"))
                    {
                        BoundingBoxLocations.LandTileLocationList.Add(tp);
                        SpatialBounding.SetQuad(tp.GetBase());
                    }
                    else
                    {
                        BoundingBoxLocations.OceanTileLocationList.Add(tp);
                    }

                    if (tp.groundObjects != null)
                    {
                        foreach (var groundObject in tp.groundObjects)
                        {
                            if (!groundObject.remove)
                            {
                                BoundingBoxLocations.GroundObjectLocationList.Add(groundObject);
                            }
                            else
                            {
                                if (groundObject is IGroundObject)
                                {
                                    IGroundObject go = (IGroundObject)groundObject;
                                    go.UpdateRespawn(gameTime);
                                }
                            }
                        }
                    }
                }
            }

            BoundingBoxLocations.InteriorTileList.Clear();
            // set interior for collision for the interior that the player is in
            if (gameState.player.playerInInterior != null)
            {
                // interior tiles for collision
                foreach (var tile in gameState.player.playerInInterior.interiorTiles)
                {
                    BoundingBoxLocations.InteriorTileList.Add(tile);
                    SpatialBounding.SetQuad(tile.GetBase());
                }

                // TODO: update the interior objects for collision (only do this when player is in there)
                foreach (var obj in gameState.player.playerInInterior.interiorObjects)
                {
                    SpatialBounding.SetQuad(obj.GetBase());
                    Collidable.Add(obj);
                }
            }

            Vector2 lastCamPos = camera.Position;

            // update any gameObjects that need to track state (will set camera pos to player)
            HashSet <Sprite> GameStateObjectUpdateOrder = gameState.Update(kstate, gameTime, camera);

            // use this to offset water noise
            camMove.X = ((camera.Position.X % GameOptions.PrefferedBackBufferWidth) / (GameOptions.PrefferedBackBufferWidth));
            camMove.Y = ((camera.Position.Y % GameOptions.PrefferedBackBufferHeight) / (GameOptions.PrefferedBackBufferHeight));

            // update ground objects (they do not track their state since they are encoded in the map)
            foreach (var sp in BoundingBoxLocations.GroundObjectLocationList)
            {
                ICanUpdate updateSp = (ICanUpdate)sp;
                updateSp.Update(kstate, gameTime, this.camera);
                groundObjectUpdateOrder.Add(sp);
            }

            // merge update orders
            HashSet <Sprite> fullUpdateOrder = GameStateObjectUpdateOrder;

            fullUpdateOrder.UnionWith(groundObjectUpdateOrder);

            // Set draw order and collision from the full update order list
            foreach (var sp in fullUpdateOrder)
            {
                if (gameState.player.playerInInterior != null)
                {
                    // only add ships and land tiles when to collision when interior is being viewed
                    if (sp is IShip || sp is ITilePiece || sp is IPlayer)
                    {
                        sp.SetBoundingBox();
                        Collidable.Add(sp);
                        SpatialBounding.SetQuad(sp.GetBase());
                    }
                }
                else
                {
                    Collidable.Add(sp);
                    SpatialBounding.SetQuad(sp.GetBase());
                    DrawOrder.Add(sp);
                }
            }

            // handle collision
            collision.Update(this.camera.Position);
            SpatialCollision();

            this.camera.Update(gameTime);
            base.Update(gameTime);
        }
コード例 #6
0
ファイル: ContainerObject.cs プロジェクト: Gvin/CodeMagic
 public void Update(Point position)
 {
     inventory.Update();
 }
コード例 #7
0
        protected override void Update(GameTime gameTime)
        {
            pastKeyboardState    = currentKeyboardState;
            currentKeyboardState = Keyboard.GetState();

            pastMouseState    = currentMouseState;
            currentMouseState = Mouse.GetState();

            HandleKeyInput();

            // Update player
            Player.Update(gameTime);

            // Update Map
            Map.Update(gameTime);

            // Update inventory
            inventoryBar.Update(gameTime);
            inventory.Update(gameTime);

            // Player collisions
            int collisionUpdateDistance = 50;
            int calls = 0;

            for (int x = (int)Player.TilePosition.X - collisionUpdateDistance; x < (int)Player.TilePosition.X + collisionUpdateDistance; x++)
            {
                for (int y = (int)Player.TilePosition.Y - collisionUpdateDistance; y < (int)Player.TilePosition.Y + collisionUpdateDistance; y++)
                {
                    if (x >= 0 && x < Map.MaxWidth && y >= 0 && y < Map.MaxHeight)
                    {
                        if (Map.Tiles[x, y].Type != TileType.Air)
                        {
                            Player.Collision(Map.Tiles[x, y].Rectangle, Map.MaxWidth, Map.MaxHeight);
                        }
                        calls++;

                        camera.Update(Player.Position, Map.MaxWidth, Map.MaxHeight);
                    }
                }
            }

            // Handle clicks
            if (currentMouseState.LeftButton == ButtonState.Pressed)
            {
                // Checks to make sure clicks are inside screen
                if (currentMouseState.X >= 0 && currentMouseState.X < camera.Bounds.Width && currentMouseState.Y > 0 && currentMouseState.Y < camera.Bounds.Height)
                {
                    float xClick = currentMouseState.ToAbsolute(camera).X;
                    float yClick = currentMouseState.ToAbsolute(camera).Y;

                    Vector2 tileClick = currentMouseState.ToAbsolute(camera).ToTile();

                    Tile tile = Map.Tiles[(int)xClick / Tile.Size, (int)yClick / Tile.Size];

                    if (tile.Type != TileType.Air)
                    {
                        Map.Drops.Add(new Drop(
                                          (int)tileClick.X,
                                          (int)tileClick.Y,
                                          Map.Tiles[(int)xClick / Tile.Size, (int)yClick / Tile.Size].Type));

                        Air air = new Air((int)xClick / Tile.Size, (int)yClick / Tile.Size, Map);
                        air.Load(Content);
                        Map.Tiles[(int)xClick / Tile.Size, (int)yClick / Tile.Size] = air;
                    }
                }
            }

            Debug.WriteLineIf(gameTime.IsRunningSlowly, "Update is running slowly: " + calls + " tiles updated");
            base.Update(gameTime);
        }
コード例 #8
0
 public override void UpdateHUD(Character character)
 {
     Inventory.Update((float)Timing.Step);
 }
コード例 #9
0
 public void Update(DestinyCharacterResponse?other)
 {
     if (other is null)
     {
         return;
     }
     if (!Inventory.DeepEquals(other.Inventory))
     {
         Inventory.Update(other.Inventory);
         OnPropertyChanged(nameof(Inventory));
     }
     if (!Character.DeepEquals(other.Character))
     {
         Character.Update(other.Character);
         OnPropertyChanged(nameof(Character));
     }
     if (!Progressions.DeepEquals(other.Progressions))
     {
         Progressions.Update(other.Progressions);
         OnPropertyChanged(nameof(Progressions));
     }
     if (!RenderData.DeepEquals(other.RenderData))
     {
         RenderData.Update(other.RenderData);
         OnPropertyChanged(nameof(RenderData));
     }
     if (!Activities.DeepEquals(other.Activities))
     {
         Activities.Update(other.Activities);
         OnPropertyChanged(nameof(Activities));
     }
     if (!Equipment.DeepEquals(other.Equipment))
     {
         Equipment.Update(other.Equipment);
         OnPropertyChanged(nameof(Equipment));
     }
     if (!Kiosks.DeepEquals(other.Kiosks))
     {
         Kiosks.Update(other.Kiosks);
         OnPropertyChanged(nameof(Kiosks));
     }
     if (!PlugSets.DeepEquals(other.PlugSets))
     {
         PlugSets.Update(other.PlugSets);
         OnPropertyChanged(nameof(PlugSets));
     }
     if (!PresentationNodes.DeepEquals(other.PresentationNodes))
     {
         PresentationNodes.Update(other.PresentationNodes);
         OnPropertyChanged(nameof(PresentationNodes));
     }
     if (!Records.DeepEquals(other.Records))
     {
         Records.Update(other.Records);
         OnPropertyChanged(nameof(Records));
     }
     if (!Collectibles.DeepEquals(other.Collectibles))
     {
         Collectibles.Update(other.Collectibles);
         OnPropertyChanged(nameof(Collectibles));
     }
     if (!ItemComponents.DeepEquals(other.ItemComponents))
     {
         ItemComponents.Update(other.ItemComponents);
         OnPropertyChanged(nameof(ItemComponents));
     }
     if (!UninstancedItemComponents.DeepEquals(other.UninstancedItemComponents))
     {
         UninstancedItemComponents.Update(other.UninstancedItemComponents);
         OnPropertyChanged(nameof(UninstancedItemComponents));
     }
     if (!CurrencyLookups.DeepEquals(other.CurrencyLookups))
     {
         CurrencyLookups.Update(other.CurrencyLookups);
         OnPropertyChanged(nameof(CurrencyLookups));
     }
 }
        new private void KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            #region txtCustomerID
            if (sender == txtCustomerID)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    txtCustomerID.Text = txtCustomerID.Text.Trim();
                    if (oCustomer.Find(txtCustomerID.Text))
                    {
                        txtCustomerID.Text = oCustomer.ID;
                        txtName.Text       = oCustomer.Name;

                        if (oCover.Find(oCustomer.ID))
                        {
                            Display();
                        }
                        else
                        {
                            Clear();
                        }
                        if (txtNoLetters.Number == 0)
                        {
                            txtNoLetters.Text = oCustomer.Signed.ToString();
                        }
                        txtNoLetters.Focus();
                        return;
                    }
                    else
                    {
                        Clear();
                        txtCustomerID.Focus();
                    }
                }

                if (e.KeyCode == Keys.F2)
                {
                    if (oCustomer.View())
                    {
                        txtCustomerID.Text = oCustomer.ID;
                        txtName.Text       = oCustomer.Name;
                        if (oCover.Find(oCustomer.ID))
                        {
                            Display();
                        }
                        else
                        {
                            Clear();
                        }
                        if (txtNoLetters.Number == 0)
                        {
                            txtNoLetters.Text = oCustomer.Signed.ToString();
                        }
                        txtNoLetters.Focus();
                    }
                    return;
                }
            }
            #endregion
            #region txtNoLetters
            if (sender == txtNoLetters)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (txtNoLetters.Number == 0)
                    {
                        txtNoLetters.Text = oCustomer.Signed.ToString();
                        txtNoLetters.Focus();
                        return;
                    }
                }
            }
            #endregion
            #region txtNoTeachers
            if (sender == txtNoTeachers)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    //LET XX=X; IF X=0 THEN LET XX=ROUND(COVER[1]/20,0); GOTO 1310
                    //1341 IF XX<>INT(XX/5)*5 THEN LET XX=5+INT(XX/5)*5; GOTO 1310
                    if (txtNoTeachers.Number == 0)
                    {
                        txtNoTeachers.Text = Math.Round(txtNoLetters.Number / 20).ToString();
                        return;
                    }

                    if (txtNoTeachers.Number != Math.Round(txtNoTeachers.Number / 5) * 5)
                    {
                        txtNoTeachers.Text = (Math.Round(txtNoTeachers.Number / 5) * 5 + 5).ToString();
                    }
                }
            }
            #endregion
            #region txtNoLetters
            if (sender == txtNoLetters)
            {
                if (e.KeyCode == Keys.Enter)
                {
                }
            }
            #endregion
            #region Default Option
            //Default option
            switch (e.KeyCode)
            {
            case Keys.Tab:
                if (!e.Shift)
                {
                    this.SelectNextControl(this.ActiveControl, true, true, true, true);
                }
                break;

            case Keys.Enter:
                if (sender != txtDetail)
                {
                    this.SelectNextControl(this.ActiveControl, true, true, true, true);
                }
                break;

            case Keys.Down:
                this.SelectNextControl(this.ActiveControl, true, true, true, true);
                break;

            case Keys.Up:
                this.SelectNextControl(this.ActiveControl, false, true, true, true);
                break;

            case Keys.F8:
                break;

            case Keys.F3:
            {
                if (MessageBox.Show("Do you really want to Delete this Record?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                {
                    MessageBox.Show("Operation Cancelled");
                    return;
                }
                else
                {
                    //oCover.Delete();
                    //Clear();
                    txtCustomerID.Focus();
                }
            }
            break;

            case Keys.F7:
                this.Close();
                break;

            case Keys.PageDown:
                if (txtCustomerID.Text.Trim() != "")
                {
                    Save();
                    if (MessageBox.Show("Do you want to print?", "Print", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        //txtPrint_Click(null, null);
                        oCustomer.PrintCoversheet();
                        Inventory oInventory = new Inventory(CompanyID);
                        oInventory.Update(oCover, Inventory.InventoryType.RollBack);
                        oInventory.Update(oCover, Inventory.InventoryType.Commit);
                    }
                    Clear();
                    txtCustomerID.Text = "";
                    txtCustomerID.Focus();
                }
                break;


                //case Keys.<some key>:
                // ......;
                // break;
            }
            #endregion
            e.Handled = true;
            return;
        }
コード例 #11
0
 public void Update(DestinyInventoryItemDefinition?other)
 {
     if (other is null)
     {
         return;
     }
     if (!DisplayProperties.DeepEquals(other.DisplayProperties))
     {
         DisplayProperties.Update(other.DisplayProperties);
         OnPropertyChanged(nameof(DisplayProperties));
     }
     if (!TooltipNotifications.DeepEqualsList(other.TooltipNotifications))
     {
         TooltipNotifications = other.TooltipNotifications;
         OnPropertyChanged(nameof(TooltipNotifications));
     }
     if (CollectibleHash != other.CollectibleHash)
     {
         CollectibleHash = other.CollectibleHash;
         OnPropertyChanged(nameof(CollectibleHash));
     }
     if (IconWatermark != other.IconWatermark)
     {
         IconWatermark = other.IconWatermark;
         OnPropertyChanged(nameof(IconWatermark));
     }
     if (IconWatermarkShelved != other.IconWatermarkShelved)
     {
         IconWatermarkShelved = other.IconWatermarkShelved;
         OnPropertyChanged(nameof(IconWatermarkShelved));
     }
     if (SecondaryIcon != other.SecondaryIcon)
     {
         SecondaryIcon = other.SecondaryIcon;
         OnPropertyChanged(nameof(SecondaryIcon));
     }
     if (SecondaryOverlay != other.SecondaryOverlay)
     {
         SecondaryOverlay = other.SecondaryOverlay;
         OnPropertyChanged(nameof(SecondaryOverlay));
     }
     if (SecondarySpecial != other.SecondarySpecial)
     {
         SecondarySpecial = other.SecondarySpecial;
         OnPropertyChanged(nameof(SecondarySpecial));
     }
     if (!BackgroundColor.DeepEquals(other.BackgroundColor))
     {
         BackgroundColor.Update(other.BackgroundColor);
         OnPropertyChanged(nameof(BackgroundColor));
     }
     if (Screenshot != other.Screenshot)
     {
         Screenshot = other.Screenshot;
         OnPropertyChanged(nameof(Screenshot));
     }
     if (ItemTypeDisplayName != other.ItemTypeDisplayName)
     {
         ItemTypeDisplayName = other.ItemTypeDisplayName;
         OnPropertyChanged(nameof(ItemTypeDisplayName));
     }
     if (FlavorText != other.FlavorText)
     {
         FlavorText = other.FlavorText;
         OnPropertyChanged(nameof(FlavorText));
     }
     if (UiItemDisplayStyle != other.UiItemDisplayStyle)
     {
         UiItemDisplayStyle = other.UiItemDisplayStyle;
         OnPropertyChanged(nameof(UiItemDisplayStyle));
     }
     if (ItemTypeAndTierDisplayName != other.ItemTypeAndTierDisplayName)
     {
         ItemTypeAndTierDisplayName = other.ItemTypeAndTierDisplayName;
         OnPropertyChanged(nameof(ItemTypeAndTierDisplayName));
     }
     if (DisplaySource != other.DisplaySource)
     {
         DisplaySource = other.DisplaySource;
         OnPropertyChanged(nameof(DisplaySource));
     }
     if (TooltipStyle != other.TooltipStyle)
     {
         TooltipStyle = other.TooltipStyle;
         OnPropertyChanged(nameof(TooltipStyle));
     }
     if (!Action.DeepEquals(other.Action))
     {
         Action.Update(other.Action);
         OnPropertyChanged(nameof(Action));
     }
     if (!Inventory.DeepEquals(other.Inventory))
     {
         Inventory.Update(other.Inventory);
         OnPropertyChanged(nameof(Inventory));
     }
     if (!SetData.DeepEquals(other.SetData))
     {
         SetData.Update(other.SetData);
         OnPropertyChanged(nameof(SetData));
     }
     if (!Stats.DeepEquals(other.Stats))
     {
         Stats.Update(other.Stats);
         OnPropertyChanged(nameof(Stats));
     }
     if (EmblemObjectiveHash != other.EmblemObjectiveHash)
     {
         EmblemObjectiveHash = other.EmblemObjectiveHash;
         OnPropertyChanged(nameof(EmblemObjectiveHash));
     }
     if (!EquippingBlock.DeepEquals(other.EquippingBlock))
     {
         EquippingBlock.Update(other.EquippingBlock);
         OnPropertyChanged(nameof(EquippingBlock));
     }
     if (!TranslationBlock.DeepEquals(other.TranslationBlock))
     {
         TranslationBlock.Update(other.TranslationBlock);
         OnPropertyChanged(nameof(TranslationBlock));
     }
     if (!Preview.DeepEquals(other.Preview))
     {
         Preview.Update(other.Preview);
         OnPropertyChanged(nameof(Preview));
     }
     if (!Quality.DeepEquals(other.Quality))
     {
         Quality.Update(other.Quality);
         OnPropertyChanged(nameof(Quality));
     }
     if (!Value.DeepEquals(other.Value))
     {
         Value.Update(other.Value);
         OnPropertyChanged(nameof(Value));
     }
     if (!SourceData.DeepEquals(other.SourceData))
     {
         SourceData.Update(other.SourceData);
         OnPropertyChanged(nameof(SourceData));
     }
     if (!Objectives.DeepEquals(other.Objectives))
     {
         Objectives.Update(other.Objectives);
         OnPropertyChanged(nameof(Objectives));
     }
     if (!Metrics.DeepEquals(other.Metrics))
     {
         Metrics.Update(other.Metrics);
         OnPropertyChanged(nameof(Metrics));
     }
     if (!Plug.DeepEquals(other.Plug))
     {
         Plug.Update(other.Plug);
         OnPropertyChanged(nameof(Plug));
     }
     if (!Gearset.DeepEquals(other.Gearset))
     {
         Gearset.Update(other.Gearset);
         OnPropertyChanged(nameof(Gearset));
     }
     if (!Sack.DeepEquals(other.Sack))
     {
         Sack.Update(other.Sack);
         OnPropertyChanged(nameof(Sack));
     }
     if (!Sockets.DeepEquals(other.Sockets))
     {
         Sockets.Update(other.Sockets);
         OnPropertyChanged(nameof(Sockets));
     }
     if (!Summary.DeepEquals(other.Summary))
     {
         Summary.Update(other.Summary);
         OnPropertyChanged(nameof(Summary));
     }
     if (!TalentGrid.DeepEquals(other.TalentGrid))
     {
         TalentGrid.Update(other.TalentGrid);
         OnPropertyChanged(nameof(TalentGrid));
     }
     if (!InvestmentStats.DeepEqualsList(other.InvestmentStats))
     {
         InvestmentStats = other.InvestmentStats;
         OnPropertyChanged(nameof(InvestmentStats));
     }
     if (!Perks.DeepEqualsList(other.Perks))
     {
         Perks = other.Perks;
         OnPropertyChanged(nameof(Perks));
     }
     if (LoreHash != other.LoreHash)
     {
         LoreHash = other.LoreHash;
         OnPropertyChanged(nameof(LoreHash));
     }
     if (SummaryItemHash != other.SummaryItemHash)
     {
         SummaryItemHash = other.SummaryItemHash;
         OnPropertyChanged(nameof(SummaryItemHash));
     }
     if (!Animations.DeepEqualsList(other.Animations))
     {
         Animations = other.Animations;
         OnPropertyChanged(nameof(Animations));
     }
     if (AllowActions != other.AllowActions)
     {
         AllowActions = other.AllowActions;
         OnPropertyChanged(nameof(AllowActions));
     }
     if (!Links.DeepEqualsList(other.Links))
     {
         Links = other.Links;
         OnPropertyChanged(nameof(Links));
     }
     if (DoesPostmasterPullHaveSideEffects != other.DoesPostmasterPullHaveSideEffects)
     {
         DoesPostmasterPullHaveSideEffects = other.DoesPostmasterPullHaveSideEffects;
         OnPropertyChanged(nameof(DoesPostmasterPullHaveSideEffects));
     }
     if (NonTransferrable != other.NonTransferrable)
     {
         NonTransferrable = other.NonTransferrable;
         OnPropertyChanged(nameof(NonTransferrable));
     }
     if (!ItemCategoryHashes.DeepEqualsListNaive(other.ItemCategoryHashes))
     {
         ItemCategoryHashes = other.ItemCategoryHashes;
         OnPropertyChanged(nameof(ItemCategoryHashes));
     }
     if (SpecialItemType != other.SpecialItemType)
     {
         SpecialItemType = other.SpecialItemType;
         OnPropertyChanged(nameof(SpecialItemType));
     }
     if (ItemType != other.ItemType)
     {
         ItemType = other.ItemType;
         OnPropertyChanged(nameof(ItemType));
     }
     if (ItemSubType != other.ItemSubType)
     {
         ItemSubType = other.ItemSubType;
         OnPropertyChanged(nameof(ItemSubType));
     }
     if (ClassType != other.ClassType)
     {
         ClassType = other.ClassType;
         OnPropertyChanged(nameof(ClassType));
     }
     if (BreakerType != other.BreakerType)
     {
         BreakerType = other.BreakerType;
         OnPropertyChanged(nameof(BreakerType));
     }
     if (BreakerTypeHash != other.BreakerTypeHash)
     {
         BreakerTypeHash = other.BreakerTypeHash;
         OnPropertyChanged(nameof(BreakerTypeHash));
     }
     if (Equippable != other.Equippable)
     {
         Equippable = other.Equippable;
         OnPropertyChanged(nameof(Equippable));
     }
     if (!DamageTypeHashes.DeepEqualsListNaive(other.DamageTypeHashes))
     {
         DamageTypeHashes = other.DamageTypeHashes;
         OnPropertyChanged(nameof(DamageTypeHashes));
     }
     if (!DamageTypes.DeepEqualsListNaive(other.DamageTypes))
     {
         DamageTypes = other.DamageTypes;
         OnPropertyChanged(nameof(DamageTypes));
     }
     if (DefaultDamageType != other.DefaultDamageType)
     {
         DefaultDamageType = other.DefaultDamageType;
         OnPropertyChanged(nameof(DefaultDamageType));
     }
     if (DefaultDamageTypeHash != other.DefaultDamageTypeHash)
     {
         DefaultDamageTypeHash = other.DefaultDamageTypeHash;
         OnPropertyChanged(nameof(DefaultDamageTypeHash));
     }
     if (SeasonHash != other.SeasonHash)
     {
         SeasonHash = other.SeasonHash;
         OnPropertyChanged(nameof(SeasonHash));
     }
     if (IsWrapper != other.IsWrapper)
     {
         IsWrapper = other.IsWrapper;
         OnPropertyChanged(nameof(IsWrapper));
     }
     if (!TraitIds.DeepEqualsListNaive(other.TraitIds))
     {
         TraitIds = other.TraitIds;
         OnPropertyChanged(nameof(TraitIds));
     }
     if (!TraitHashes.DeepEqualsListNaive(other.TraitHashes))
     {
         TraitHashes = other.TraitHashes;
         OnPropertyChanged(nameof(TraitHashes));
     }
     if (Hash != other.Hash)
     {
         Hash = other.Hash;
         OnPropertyChanged(nameof(Hash));
     }
     if (Index != other.Index)
     {
         Index = other.Index;
         OnPropertyChanged(nameof(Index));
     }
     if (Redacted != other.Redacted)
     {
         Redacted = other.Redacted;
         OnPropertyChanged(nameof(Redacted));
     }
 }