// Let's Modify the colors in a Range public void Do(GridStates states) { startMemento = new CubeGridMemento(states.currentState); for (int i = myStart; i < myEnd; i++) { states.currentState.colors[i] = myColor; Debug.Log(myColor); } }
/// <summary> /// Copy Constructor /// </summary> /// <param name="memento">Memento.</param> public CubeGridMemento(CubeGridMemento memento) { colors = memento.colors.ToDictionary(entry => entry.Key, entry => entry.Value); }
public GridStates(Dictionary <int, Color> startColors) { currentState = new CubeGridMemento(startColors); }