private void RegisterDiagonalValueTransformationEvents(IPlayableLocation cell) { ApplyUpRight(cell); ApplyUpLeft(cell); ApplyDownLeft(cell); ApplyDownRight(cell); }
private void RegisterLinearValueTransformationEvents(IPlayableLocation cell) { ApplyUp(cell); ApplyRight(cell); ApplyDown(cell); ApplyLeft(cell); }
private void ApplyUpRight(IPlayableLocation cell) { if (cell.Location.Item1 == 0 || cell.Location.Item2 == cell.Parent.Bounds || !cell.Parent.Metadata.TryGetValue(new Tuple <int, int>(cell.Location.Item1 - 1, cell.Location.Item2 + 1), out var neighbor)) { return; } cell.LocationScoreUpdatedDiagonally += neighbor.HandleLocationScoreUpdatedDiagonally; }
private void ApplyUp(IPlayableLocation cell) { if (cell.Location.Item1 == 0 || !cell.Parent.Metadata.TryGetValue(new Tuple <int, int>(cell.Location.Item1 - 1, cell.Location.Item2), out var neighbor)) { return; } cell.LocationScoreUpdatedLinearly += neighbor.HandleLocationScoreUpdatedLinearly; }