Show / Hide Table of Contents

    Class WalkPlan

    Class that represents a creature's walk plan.

    Inheritance
    System.Object
    WalkPlan
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Fibula.Creatures.Contracts.Structs
    Assembly: Fibula.Creatures.Contracts.dll
    Syntax
    public class WalkPlan

    Constructors

    | Improve this Doc View Source

    WalkPlan(WalkPlanStrategy, Func<Location>, Int32, Location[])

    Initializes a new instance of the WalkPlan class.

    Declaration
    public WalkPlan(WalkPlanStrategy strategy, Func<Location> goalDeterminationFunction, int goalDistance = 1, params Location[] startingWaypoints)
    Parameters
    Type Name Description
    WalkPlanStrategy strategy

    The strategy of the plan.

    System.Func<Location> goalDeterminationFunction

    A function used to determine the goal of this plan.

    System.Int32 goalDistance

    The distance to consider the walk plan at goal.

    Location[] startingWaypoints

    The waypoints already known to the goal.

    Properties

    | Improve this Doc View Source

    GetGoalLocation

    Gets the function that determines the goal location, used when requesting recalculation of the path to the goal.

    Declaration
    public Func<Location> GetGoalLocation { get; }
    Property Value
    Type Description
    System.Func<Location>
    | Improve this Doc View Source

    GoalTargetDistance

    Gets the target distance to use when requesting recalculation of the path to the goal.

    Declaration
    public int GoalTargetDistance { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    State

    Gets or sets the state of this walk plan.

    Declaration
    public WalkPlanState State { get; set; }
    Property Value
    Type Description
    WalkPlanState
    | Improve this Doc View Source

    Strategy

    Gets the strategy of this walk plan.

    Declaration
    public WalkPlanStrategy Strategy { get; }
    Property Value
    Type Description
    WalkPlanStrategy
    | Improve this Doc View Source

    WaitTime

    Gets the recommended wait time based on the last Checkpoint(Location, Random) run.

    Declaration
    public TimeSpan WaitTime { get; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    Waypoints

    Gets the waypoints of this walk plan.

    Declaration
    public LinkedList<Location> Waypoints { get; }
    Property Value
    Type Description
    System.Collections.Generic.LinkedList<Location>

    Methods

    | Improve this Doc View Source

    Checkpoint(Location, Random)

    Steps into the next waypoint in the plan by comparing it to the current location and updating its state. i.e. this flags the plan to recalculate as per the WalkPlanStrategy rules.

    Declaration
    public void Checkpoint(Location currentLocation, Random rng = null)
    Parameters
    Type Name Description
    Location currentLocation

    The current location to check against.

    System.Random rng

    Optional. A pseudo-random number generator to work with.

    | Improve this Doc View Source

    RecalculateWaypoints(Location, IEnumerable<Direction>)

    Recalculates the plan's waypoints (locations) given a start location and some directions.

    Declaration
    public void RecalculateWaypoints(Location startLocation, IEnumerable<Direction> directions)
    Parameters
    Type Name Description
    Location startLocation

    The start location.

    System.Collections.Generic.IEnumerable<Direction> directions

    The directions to create the waypoints with.

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.