85 Commits
Author SHA1 Message Date
moonysolari 3206d3d8b7 Save timer transition results (#20)
* Save timer transition results

* prettier
2023-05-11 10:46:05 +01:00
AnthonyFuller dbd1594fb9 Clear timers using pop 2023-05-09 01:43:41 +01:00
Reece Dunham 8ac4d2e92f prettify
Signed-off-by: Reece Dunham <[email protected]>
2023-05-08 20:27:29 -04:00
Lennard Fonteijn f42497c291 Timers (#19)
* Fixed situation where timers weren't properly cleared when a state transition occurs
Fixed situation where timer logic was performed too late in the process

* Fixed broken unit tests
2023-05-09 01:18:20 +01:00
Anthony Fuller 5df06dcba5 Use switch statements when handling ops (#18)
* Use switch statements when handling ops

* Change in to of

* Add test for ordering of actions

* Simplify ordering test

* Update with changes from main

---------

Signed-off-by: Anthony Fuller <[email protected]>
2023-05-08 22:31:40 +01:00
moonysolari feda0cde1a Only read from the context if a reference is prepended with a $ (#17)
* Fixes The Scenic Route

* Only read from the context if prepended with a $ + tests
2023-05-08 23:01:09 +02:00
AnthonyFuller 6a5fb927e3 Support 2 operand $mul actions 2023-05-06 17:49:34 +01:00
Govert de GansandReece Dunham 40aa5133ec Support actions with constants (#16)
* Add support for actions that reference constants

* Add test with an action that references a constant

---------

Signed-off-by: Reece Dunham <[email protected]>
Co-authored-by: Reece Dunham <[email protected]>
2023-05-02 19:09:56 -04:00
moonysolari f4aa7be23d Delete values regardless of whether they are truthy (#15)
* Delete values when they are not truthy

* Drop contractId when not truthy

* change contractId order
2023-04-26 09:51:21 +01:00
AnthonyFuller 8e58624b73 Add constants to action context 2023-04-20 12:32:26 +01:00
Anthony Fuller 512b2996a4 Overhaul $reset to use the original context (#13)
* Overhaul `$reset` to use the original context

* Update spec with new `$reset` functionality

* Give empty object as original context
2023-04-19 21:49:56 +01:00
Anthony Fuller 70c7cedba8 Add support for $reset (#12)
* Add support for the reset op

* Add $reset to the spec

* Add tests for $reset

* Fix $reset test
2023-04-19 01:54:41 +01:00
Anthony Fuller 15782870b8 Fix irregular events being handled incorrectly (#11) 2023-04-09 21:20:54 +01:00
moonysolari 0275255508 Pass contract Ids for conditions and transitions (#10) 2023-04-06 22:45:02 -04:00
moonysolari a4f827c7a5 Support long arrays for $eq (#9) 2023-04-06 17:40:01 -04:00
moonysolari 533a77e285 Support contract IDs for $pushunique (#8)
* Support ContractId
2023-03-19 14:35:03 -04:00
moonysolari d2d4c45335 Remove timer upon completion (#6)
* remove timer once completed

* Comments for timer deletion

* Add test for timer deletion and re-creation
2023-03-10 21:43:22 -05:00
moonysolari f07636f9d1 Fix event handling (#3)
* Try to fix context returned

* Fix bugs caused by using `context`

* Fix a broken test
2023-01-15 00:52:22 -05:00
Reece Dunham e046c25e76 Remove $div node - it never existed (oops) 2022-12-07 13:03:28 -05:00
Reece Dunham d36527bd37 [Breaking] Require timestamp on events 2022-09-01 10:26:23 -04:00
Reece Dunham 455edd3e67 Fix the timer test 2022-08-30 20:58:56 -04:00
Reece Dunham 9490394b3d Properly implement game timers 2022-08-30 19:31:30 -04:00
Reece Dunham 4b94eb1878 Add tests for $ge and $le 2022-08-30 15:45:54 -04:00
Reece Dunham d3e9d00d10 Return false if no event timestamp is given 2022-08-30 15:33:12 -04:00
Reece Dunham 8b3a0aa372 Require event timestamp as the timing system is different 2022-08-30 14:26:27 -04:00
Reece Dunham 1c402f9ed4 Custom deep clone functions is probably another bad idea 2022-08-20 08:38:40 -04:00
Reece Dunham 2796e5042c Rewrite timers 2022-07-31 21:17:09 -04:00
Reece Dunham 1fee370c0f Add external access to _path 2022-07-31 19:41:05 -04:00
Reece Dunham d456441f0b Several big breaking changes
- Nuke old timer implementation, working on a new one.
- Let consumers specify a logger.
- Let consumers specify a deep clone function.
- Run Prettier.
2022-07-31 16:01:07 -04:00
Reece Dunham ce21efc9b6 Give types their own file 2022-07-30 21:17:31 -04:00
Reece Dunham 8ca29f2a7e Ensure input is not actually falsy 2022-07-30 20:34:22 -04:00
Reece Dunham 76324d7f0c Support $contains for strings 2022-07-17 03:13:46 -04:00
Reece Dunham 53dfd7e4ab Run Prettier 2022-07-16 02:35:06 -04:00
Reece Dunham 1c3efb1f02 Add tests for strange string reference edge cases 2022-07-16 01:54:45 -04:00
Reece Dunham 9e27d35b09 Improve the spec documentation, rename gte and lte to ge and le to comply with the actual implementations in the game. 2022-07-14 11:55:59 -07:00
Reece Dunham 58aea16d78 Extra handleEvent tests. 2022-07-13 00:32:15 -04:00
Reece Dunham 3d2c19a349 Handle pushunique as a condition.
This needs tests to be written for it!
2022-07-12 02:07:23 -04:00
Reece Dunham 3c2974082b Bump version to 4.1.0 2022-07-01 23:43:16 -04:00
Reece Dunham 6f6424bcc6 Support Count property on arrays, move findNamedChild to utils, drop support for comparing arrays 2022-07-01 12:42:46 -04:00
Reece Dunham c1a10618b7 v4.0.0 2022-06-20 15:17:53 -04:00
Reece Dunham 679d7fb79d Support $remove 2022-06-20 14:03:40 -04:00
Reece Dunham 8a53253d68 Change how immediate states are handled, add copyright to all eligible files. 2022-06-16 15:57:13 -04:00
Reece Dunham e001b19382 Add basic tracing, run prettier 2022-06-10 15:31:10 -04:00
Reece Dunham 48b25d8aa7 Handle nested loops 2022-05-27 23:30:49 -04:00
Reece Dunham 398f105249 Fix bugs, greatly improve coverage 2022-05-06 17:57:11 -04:00
Reece Dunham f85c965dd3 Run prettier over stuff 2022-05-06 17:19:30 -04:00
Reece Dunham 6c8df49005 Fix a bunch of stuff with timers 2022-04-24 16:23:15 -04:00
Reece Dunham 3f54cd84ee Tag v3.2.0 2022-04-23 21:58:19 -04:00
Reece Dunham 98963c0a3b Handle immediately executed events in states 2022-04-10 23:22:48 -04:00
Reece Dunham 43cdc85051 Remove circular imports 2022-04-05 12:33:15 -04:00