Class FieldZoneFTC

java.lang.Object
me.wobblyyyy.pathfinder.zones.FieldZoneFTC
All Implemented Interfaces:
Zone

public class FieldZoneFTC
extends java.lang.Object
implements Zone
A generic zone representing an FTC field.
Since:
0.1.0
Author:
Colin Robertson
  • Constructor Summary

    Constructors
    Constructor Description
    FieldZoneFTC()  
  • Method Summary

    Modifier and Type Method Description
    int getComponents()
    Get the total count of components.
    double getDriveSpeedMultiplier()
    Just in case you wanted to have certain zones automatically change the speed at which the robot drives at.
    java.lang.String getName()
    Get the name of the specific zone.
    Shape getParentShape()
    Get the "parent shape" of the zone.
    int getZonePriority()
    The priority of the zone - read the rest of this JavaDoc to understand.
    boolean isSolid()
    Is the zone a solid?

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface me.wobblyyyy.pathfinder.geometry.Zone

    isPointInZone
  • Constructor Details

    • FieldZoneFTC

      public FieldZoneFTC()
  • Method Details

    • getName

      public java.lang.String getName()
      Description copied from interface: Zone
      Get the name of the specific zone.

      Zone names don't matter... at all, really. They mattered in the first release of Pathfinder, as zone collisions made use of String keys for a reason I couldn't possibly explain. But they don't anymore. You can really just make the name whatever you'd like, but for the sake of consistency and clean code, I name all of my zones after the class name.

      Specified by:
      getName in interface Zone
      Returns:
      the name of the zone.
    • getParentShape

      public Shape getParentShape()
      Description copied from interface: Zone
      Get the "parent shape" of the zone.

      A "parent shape" is quite literally just a regular shape. Zones are based on shapes, and parent shapes are those shapes. You could, for example, have a rectangular zone name "Zone_A." Zone A's parent shape would be considered the rectangle which Zone A uses to define it's boundaries.

      Specified by:
      getParentShape in interface Zone
      Returns:
      a parent shape.
    • getZonePriority

      public int getZonePriority()
      Description copied from interface: Zone
      The priority of the zone - read the rest of this JavaDoc to understand.

      Each and every zone has a priority. A priority is just how important that zone is compared to other zones. Higher priorities are more important than lower ones - for example, if the robot is in two zones at once (the main field zone, and, say, an objective zone) and the main zone has a priority of 0 compared to the objective zone's priority of 1, the objective zone's priority will override that of the main zone. If the objective zone has a speed multiplier which is higher or lower than the main zone's multiplier, that new multiplier will override the current one.

      Specified by:
      getZonePriority in interface Zone
      Returns:
      the zone's priority.
    • getDriveSpeedMultiplier

      public double getDriveSpeedMultiplier()
      Description copied from interface: Zone
      Just in case you wanted to have certain zones automatically change the speed at which the robot drives at.
      Specified by:
      getDriveSpeedMultiplier in interface Zone
      Returns:
      a drive speed multiplier
    • getComponents

      public int getComponents()
      Description copied from interface: Zone
      Get the total count of components.

      Countable components include things like lines and arcs. Note that component counts have all but no utility, save debugging (or flexing) purposes. You know how showing off how hard you can push the engine of your shitty little car you got from your grandparents for $3,000 is some kind of flex? In the same way, showing off how many virtually-rendered components your FTC code can have is a flex as well.

      Specified by:
      getComponents in interface Zone
      Returns:
      how many components there are, in total
    • isSolid

      public boolean isSolid()
      Description copied from interface: Zone
      Is the zone a solid?

      Non-solid zones are sorted out during the pathfinding core's initialization stage in order to reduce the price of checking for potential collisions.

      Solid objects can't be collided with, meaning that the pathfinder will automatically navigate around them. Additionally, solid objects won't be collision-checked against each other, as any collisions between them are intentional and can't be changed with the robot.

      Specified by:
      isSolid in interface Zone
      Returns:
      whether or not the zone is solid.