Associating actions to states and transitions

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start at the types that expose SetAction(IAction action) for states and transitions, and read the IAction implementation used for simple actions. Add System.Action<...> overloads there that wrap the delegate in that simple implementation, keeping the existing IAction method working. Confirm the overloads compile for both states and transitions and add cases to the existing test project; done when lambdas can be passed to both.

Written by the indexing model from the issue text.

Description

How it works

To define an action, we have to set an implementation of IAction and then call the method SetAction(IAction action).

The problem

Also this way of adding actions works well with complex actions or programs, it is a heavy syntax for defining simple or test actions, like actions just displaying a message.

The solution

Add methods SetAction(System.Action<...>) for both states and transitions to allow defining new actions with a lamba and lighter syntax.

Dominant language
C#
Stars
0
Forks
1
Avg merge
1h 1m
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Natvs/Nt.Automaton

All issues in Natvs/Nt.Automaton

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.