LibDataStructures (2024.11.27)

Change Log:
——————–
## 2024.11.27
– add basic library structure
– add Stack
– add basic documentation

Description:
——————–
https://github.com/m00nyONE/LibDataStructures

# LibDataStructures

**LibDataStructures** is a lightweight library for The Elder Scrolls Online (ESO) that provides developers with essential data structures to enhance their addon development.

More datastructures will follow very soon

## Features

– **Stack**:
– Push values onto the stack.
– Pop values from the stack.
– Peek at the top value without removing it.
– Clear all values from the stack.
– Clone the stack for independent manipulation.
– Iterate over stack elements from top to bottom.
– Check if the stack is empty.
– Get the current size of the stack.

## Installation

1. Download the latest release of the library from (#).
2. Place the `LibDataStructures` folder into your `AddOns` directory:
“`
Documents/Elder Scrolls Online/live/AddOns/
“`
3. Add the library dependency to your addons manifest file (`.txt`):
“`
DependsOn: LibDataStructures>=20241127
“`

## Usage

Here is an example of how to use LibDataStructures to work with a stack:

### Initialization
“`lua
local LDS = LibDataStructures
local stack = LDS.Stack:New()
“`

### Basic Operations
“`lua
— Push values onto the stack
stack:Push(10)
stack:Push(20)

— Peek at the top value
d(stack:Peek()) — Output: 20

— Pop values from the stack
d(stack:Pop()) — Output: 20
d(stack:Pop()) — Output: 10
“`

### Utility Functions
“`lua
— Check if the stack is empty
d(stack:IsEmpty()) — Output: true

— Clear the stack
stack:Push(1)
stack:Push(2)
stack:Clear()
d(stack:Len()) — Output: 0

— Clone the stack
stack:Push(100)
local clonedStack = stack:Clone()
d(clonedStack:Pop()) — Output: 100
“`

### Iteration
“`lua
— Push multiple values
stack:Push(1)
stack:Push(2)
stack:Push(3)

— Iterate through the stack
for value in stack:Iterate()…

Leave a Reply

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.