GameMaker Studio 2 (2.3)
Icon

Lightweight Data Structures

FrostyCat

You must be logged in to obtain assets

Description

Overview

Lightweight Data Structures is a complete struct-based, garbage-collected replacement for GMS 2's built-in data structures.

Features

  • Complete coverage: Stack, Queue, List, Map, Grid, Priority Queue (Heap)
  • No need for manual cleanup (no more ds_*_destroy())
  • Nest without explicit type marking (no more ds_map_add_list() or ds_list_mark_as_map(), for example)
  • Load and save in one line, with optional encryption
  • Iterators for looping through lists, maps and grids
  • Sort lists and grids by custom criteria

Documentation

See the Wiki section on the official GitHub repository.

Examples

Simple List Example:

var list = new List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
list.shuffle();
show_message("Your draws are: " + string(list.get(0)) + "," + string(list.get(1)) + "," + string(list.get(2)));

Simple Nested Map Example:

var characters = new List(
    new Map("name", "Alice", "hp", 4),
    new Map("name", "Bob", "hp", 5),
    new Map("name", "Caitlyn", "hp", 6)
);
lds_save_encrypted(characters, working_directory + "characters.dat", "secretChars");

var loadedCharacters = lds_load_encrypted(working_directory + "characters.dat", "secretChars");
show_message(
    "Stats:" +
    "\n- Alice: " + string(loadedCharacters.get(0).get("hp")) +
    "\n- Bob: " + string(loadedCharacters.get(1).get("hp")) +
    "\n- Caitlyn: " + string(loadedCharacters.get(2).get("hp"))
);

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS2.3 - Version 1.0.0. Published September 20, 2020

Initial release.

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait

Back to Top