public void SetSoftBoundary(SoftBoundary boundary) { this.CurrentSoftBoundary = boundary; this.LastSoftBoundaryComponent = boundary ? boundary.GetFirstComponent() : null; this.IsOutsideSoftBounds = true; }
public void OutsideSoftBounds(SoftBoundaryComponent boundaryComponent) { if (this.CurrentExternalSoftBoundary == boundaryComponent.SoftBoundary) { this.CurrentExternalSoftBoundary = null; } this.SoftBoundaryComponents.Remove(boundaryComponent); if (this.SoftBoundaryComponents.Count <= 0) { this.IsOutsideSoftBounds = true; } }
public void InsideSoftBounds(SoftBoundaryComponent boundaryComponent) { this.CurrentExternalSoftBoundary = boundaryComponent.SoftBoundary; // For fish that don't have a current soft boundary assigned, do nothing if (this.CurrentSoftBoundary == null) { return; } if (this.CurrentSoftBoundary.Contains(boundaryComponent)) { this.CurrentExternalSoftBoundary = null; this.SoftBoundaryComponents.Add(boundaryComponent); this.LastSoftBoundaryComponent = boundaryComponent; if (this.IsOutsideSoftBounds) { this.IsOutsideSoftBounds = false; } } }
public bool Contains(SoftBoundaryComponent component) { return(this.SoftBoundaryComponents.Contains(component)); }