private void RemoveWayPoint(Vector3Int pos, RangeWayPoint wayPoint) { Centers.Remove(pos); positions.Remove(pos); RemoveRange(wayPoint); }
private void AddWayPoint(Vector3Int pos, RangeWayPoint wayPoint) { Centers.Add(pos); positions.Add(pos, wayPoint); AddRange(wayPoint); }
private void RemoveRange(RangeWayPoint wayPoint) { Vector3Int[] bound = wayPoint.Bound(); for (int i = 0; i < bound.Length; i++) { if (positions[bound[i]] == wayPoint) { positions.Remove(bound[i]); } } }
private void AddRange(RangeWayPoint wayPoint) { Vector3Int[] bound = wayPoint.Bound(); for (int i = 0; i < bound.Length; i++) { if (!positions.ContainsKey(bound[i])) { positions.Add(bound[i], wayPoint); } } }