Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanjosolutions/luaset
A library for working with sets.
https://github.com/sanjosolutions/luaset
wow wow-addon wow-addon-lib
Last synced: 5 days ago
JSON representation
A library for working with sets.
- Host: GitHub
- URL: https://github.com/sanjosolutions/luaset
- Owner: SanjoSolutions
- License: unlicense
- Created: 2020-12-27T23:03:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-31T07:15:34.000Z (12 months ago)
- Last Synced: 2024-05-01T19:25:55.503Z (8 months ago)
- Topics: wow, wow-addon, wow-addon-lib
- Language: Lua
- Homepage: https://www.patreon.com/addons_by_sanjo
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lua Set
This work is devoted to God.
A library for working with sets. This library can save add-on developers some work.
## Things included
* Set.new: a constructor for creating a new set.
* Set.create: a function for creating a set. Functionally the same as Set.new.The following functions / methods can be called in two ways:
* When a set has been created with Set.new or Set.create then "add" for example can be called like this:
```lua
local set = Set.create()
set:add(1)
```* Or by passing the set as first argument.
```lua
local set = Set.create()
set.add(set, 1)
```This method also works for tables which fit the structure of set tables (just called set in other places in this documentation).
**Functions / Methods:**
* **add**: adds an element to the set.
* **copy**: copies a set.
* **iterator**: creates an iterator for the set.
* **toList**: creates a list out of the set.
* **size**: returns the number of elements in the set.
* **contains**: checks if the set contains a value.
* **containsWhichFulfillsCondition**: checks if the set contains an element which fulfills specific conditions.
* **remove**: removes an element from the set.
* **intersect**: creates an intersection of multiple sets.
* **equals**: checks if two sets are equal.
* **union**: creates a union of a set.
* **hasElements**: checks if a set has any elements.
* **isEmpty**: checks if a set is empty.## How to use
Please see "[How to use Library](https://github.com/SanjoSolutions/LuaLibrary#how-to-use)" for how to use this library.