-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace bool?[]
with a custom type of Line
#1
Comments
Because we have implemented implicit conversion to |
We have implemented an implicit conversion to and from bool?[]. However It is unclear what the best approach here is. If we throw an |
We started implementing this as a
As such it might be better to implement this as In light of both |
Initially the plan was to implement |
Overview
Trying to represent all cells with an
IEnumerable<bool?>
which we internally convert intobool?[]
is clumsy. The true, false, or null has meaning in our domain which is implicit. We can be more explicit about this. Setting up data is also clumsy and can be seen by test cases being awkward to visually parse e.g. what was the index of thattrue
value again? When debugging issues withIStrategy
implementations it was difficult to see what the data genuinely was.We should introduce a custom type of
Line
. This will be anIEnumerable<CellState>
whereCellState
is an enumeration where we explicitly state meaning.Required Behaviour
IEnumerable<CellState>
that contains at least one itembool?[]
Parse
method that accepts a string of e.g. "001_1_00"TryParse
method following the accepted conventionstring
CellState[]
because it would allow people to change state, although you could expose e.g.IReadOnlyCollection<CellState>
The text was updated successfully, but these errors were encountered: