Ejemplo n.º 1
0
    // 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);
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Copy Constructor
 /// </summary>
 /// <param name="memento">Memento.</param>
 public CubeGridMemento(CubeGridMemento memento)
 {
     colors = memento.colors.ToDictionary(entry => entry.Key, entry => entry.Value);
 }
Ejemplo n.º 3
0
 public GridStates(Dictionary <int, Color> startColors)
 {
     currentState = new CubeGridMemento(startColors);
 }