Giter VIP home page Giter VIP logo

Comments (1)

reviniere avatar reviniere commented on May 25, 2024

Some suggestions for content on that page:

Add _search as a sequence keyword with description like:

  • "_search" Searches for any containers which match all the given matching conditions, and merges the provided updates to all matching containers.

Add subheadings under Mirroring Structure heading to make it clearer to identify what each codeblock is for, e.g.

  • Sample input file
  • Merging changes to a sequence by index number
  • Merging changes to a sequence by search terms
  • Appending to a sequence
  • Replacing a sequence
  • Deleting a key

Under the new subheading regarding search terms, content such as:

Merging changes to a sequence by search terms

As an alternative to explicitly specifying the list index to update a container at, you can also search for containers which match a set of conditions. This search feature will merge your replacement values to all containers in the list which match all your search terms.

The format of using this search is as follows:

Sequence = [
    "_search", [
        { TargetKey = "target_value" }
        { TargetKey = "replacement_value" }
        ...
    ]
]

The keys for both the target_value and replacement_value can be the same or different. The target_value and replacement_value containers may also both contain multiple key-value pairs, e.g.

Sequence = [
    "_search", [
        { 
            Name = "WeaponThrow" 
            FullyAutomatic = true
        }
        { 
            FullyAutomatic = false
            Control = "Attack2"
            MinChargeToFire = 1.0
            LoseControlOnRelease = true
            SwapOnFire = "_delete"
        }
    ]
]

To perform multiple searches at the same level, add further pairs of match conditions and replacement values, e.g.

Sequence = [
    "_search", [
        { TargetKey = "target_value" }
        { TargetKey = "replacement_value" }
        { OtherTargetKey = "another_target_value" }
        { OtherTargetReplacement = "another_replacement_value" }
    ]
]

To make the same change as the previous example where a container was updated using an explicit index number, to change the value at MyKey to "newvalue", this is the corresponding merge sjson which identifies the container to update by finding containers where OtherKey = 45

{
  Sequence = [
    "_search"
    [
        { OtherKey = 45 }
        { MyKey = "newvalue" }
    ]
  ]
}

from sgg-mod-format.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.