コード例 #1
0
 public static ElementsMatchGameState ConcealAllElementsAction(ElementsMatchGameState state) =>
 state.With
 (
     elementStates: state.ElementStates.Values
     .Select(x => x.With(concealed: true))
     .ToDictionary(x => x.AtomicNumber).AsReadOnly()
 );
コード例 #2
0
 public static ElementsMatchGameState RevealElementAction(ElementsMatchGameState state, RevealElementAction action) =>
 state.With
 (
     elementStates: state.ElementStates.Values
     .Select(x =>
             x.AtomicNumber != action.AtomicNumber
                                         ? x
                                         : x.With(concealed: false))
     .ToDictionary(x => x.AtomicNumber).AsReadOnly()
 );