Skip to content

Commit 74a8458

Browse files
committed
Initial commit
0 parents  commit 74a8458

26 files changed

+2717
-0
lines changed

GMLodash.yyp

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
MIT License
2+
3+
Based on Lodash, copyright JS Foundation and other contributors <https://js.foundation/>,
4+
5+
====
6+
7+
Copyright (c) 2020 Zach Reedy
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy
10+
of this software and associated documentation files (the "Software"), to deal
11+
in the Software without restriction, including without limitation the rights
12+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
copies of the Software, and to permit persons to whom the Software is
14+
furnished to do so, subject to the following conditions:
15+
16+
The above copyright notice and this permission notice shall be included in all
17+
copies or substantial portions of the Software.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25+
SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# GMLodash
2+
3+
This library is a port of the popular JavaScript library [Lodash](https://lodash.com/) to GML 2.3. The intent is to be a utility library that enables a functional programming workflow. Not dissimillar to C#'s LINQ, or Python's List Comprehension.
4+
5+
## Getting Started
6+
### Installation via Local Package (.yymps)
7+
8+
GameMaker Studio 2 allows you to import assets, including scripts and shaders, directly into your project via the "Local Package" system. From the [Releases](https://github.com/DatZach/GMLodash/releases) tab for this repo, download the .yymps file for the latest version. In the GMS2 IDE, load up your project and click on "Tools" on the main window toolbar. Select "Import Local Package" from the drop-down menu then import all scripts from the GMLodash package.
9+
10+
### Installation via Copy/Paste
11+
12+
You can simply copy and paste the contents of [GMlodash.gml](https://github.com/DatZach/Destructors/blob/master/scripts/GMLodash/GMLodash.gml) into a new Script in your project.
13+
14+
## Usage
15+
Visit the [Documentation](https://github.com/DatZach/GMLodash/wiki) for full documentation on the API.
16+
### Examples
17+
```javascript
18+
_.filter([1,2,3,4], function (x) { return x <= 2; }) => [1,2] // array -> array
19+
20+
var list = ds_list_create();
21+
ds_list_add(1,2,3,4);
22+
_.filter(list, function (x) { return x <= 2; }) => list(1,2) // list -> list
23+
```
24+
```javascript
25+
var inventory = {
26+
items: [
27+
{ itemId: "Sword", stock: 1 },
28+
{ itemId: "Map", stock: 1 },
29+
{ itemId: "Gem", stock: 4 }
30+
]
31+
};
32+
33+
// List of the the value of property "itemId" for each element
34+
_.map(inventory.items, "itemId") => ["Sword","Map","Gem"]
35+
```
36+
```javascript
37+
// Get the total stock of inventory
38+
_.reduce(inventory, "stock", 0) => 6
39+
```
40+
```javascript
41+
// Some elements's itemId property = "Map"
42+
_.some(inventory, ["itemId","Map"]) => true
43+
```
44+
```javascript
45+
// All items in the inventory have >= 1 stock (truthy evaluation)
46+
_.every(inventory, "stock") => true
47+
```
48+
49+
## Running the Unit Tests
50+
51+
Clone this repo, open and run the project in GameMaker: Studio. If all Unit Tests pass, a message will be printed in the Output console and the game will close. Otherwise an error will be shown on screen.
52+
53+
## Authors
54+
55+
* **Zach Reedy** - *Primary developer* - [DatZach](https://github.com/DatZach)
56+
57+
## License
58+
59+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

options/amazonfire/options_amazonfire.yy

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

options/android/options_android.yy

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

options/html5/options_html5.yy

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

options/ios/options_ios.yy

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

options/linux/options_linux.yy

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)