Exemple #1
0
    public void SetSoftBoundary(SoftBoundary boundary)
    {
        this.CurrentSoftBoundary = boundary;

        this.LastSoftBoundaryComponent = boundary ? boundary.GetFirstComponent() : null;

        this.IsOutsideSoftBounds = true;
    }
Exemple #2
0
    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;
        }
    }
Exemple #3
0
    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;
            }
        }
    }
Exemple #4
0
 public bool Contains(SoftBoundaryComponent component)
 {
     return(this.SoftBoundaryComponents.Contains(component));
 }