public Operation(string name, TileGrid.Element oldElement, TileGrid.Element newElement, bool incrementOperationCounter = true) { m_Name = name; AddDelta(oldElement, newElement); m_IncrementOperationCounter = incrementOperationCounter; }
public void AddDelta(TileGrid.Element oldElement, TileGrid.Element newElement, GameObject tile = null) { if (oldElement == null && newElement == null) { return; } var gridIndex = newElement == null ? oldElement.m_GridIndex : newElement.m_GridIndex; var unique = ConfirmUniqueness(gridIndex); if (!unique) { return; } var delta = new Delta() { OldState = oldElement == null ? new TileState() : oldElement.ToState(), NewState = newElement == null ? new TileState() : newElement.ToState(), }; delta.GridIndex = gridIndex; delta.Tile = tile; m_Deltas.Add(delta); }
static public void AddDelta(TileGrid.Element oldElement, TileGrid.Element newElement, GameObject tile = null) { s_CurrentOperation.AddDelta(oldElement, newElement, tile); }