Example #1
0
 private void RegisterDiagonalValueTransformationEvents(IPlayableLocation cell)
 {
     ApplyUpRight(cell);
     ApplyUpLeft(cell);
     ApplyDownLeft(cell);
     ApplyDownRight(cell);
 }
Example #2
0
 private void RegisterLinearValueTransformationEvents(IPlayableLocation cell)
 {
     ApplyUp(cell);
     ApplyRight(cell);
     ApplyDown(cell);
     ApplyLeft(cell);
 }
Example #3
0
        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;
        }
Example #4
0
        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;
        }