Class Map

java.lang.Object
me.wobblyyyy.pathfinder.map.Map
Direct Known Subclasses:
EmptyFRC, EmptyFTC

public class Map
extends java.lang.Object
A representation of all of the physical elements on a playing field.

Maps are simply a list of a bunch of different zones. In order to create a new map, you can create a class that extends this one, and, in the constructor of your extension, put a call to super with a new DynamicArray of zones representing the field's physical layout.

Maps themselves aren't all that difficult to figure out how to use - the real issue is zones and shapes. For your convenience, both fo those are linked right here.

Zone/map/field wrapping is not yet done - we need to work on that before we can hope to do anything important with this library.

Since:
0.1.0
Author:
Colin Robertson
  • Field Summary

    Fields
    Modifier and Type Field Description
    static me.wobblyyyy.edt.DynamicArray<java.lang.String> FIELD_NAMES
    A list of all of the possible names for field zones.
    me.wobblyyyy.edt.DynamicArray<Zone> zones
    All of the zones contained within the map.
  • Constructor Summary

    Constructors
    Constructor Description
    Map()
    Create a new map without any elements.
    Map​(me.wobblyyyy.edt.DynamicArray<Zone> zones)
    Create a new map with a list of zones.
    Map​(Zone zone)
    Create a new map with a single zone.
    Map​(Zone... zones)
    Create a new map with several zones.
  • Method Summary

    Modifier and Type Method Description
    private static boolean isField​(Zone zone)
    Check whether or not a given zone is technically field.
    private me.wobblyyyy.edt.DynamicArray<Zone> wrap​(me.wobblyyyy.edt.DynamicArray<Zone> zones)
    Wrap an entire field with four zones, to prevent the pathfinder from finding paths that are out-of-bounds.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FIELD_NAMES

      public static final me.wobblyyyy.edt.DynamicArray<java.lang.String> FIELD_NAMES
      A list of all of the possible names for field zones.

      Please, for the sake of everyone's sanity - name every single zone that's a field "field". Every potential problem is thus averted - wonderful, right?!

    • zones

      public final me.wobblyyyy.edt.DynamicArray<Zone> zones
      All of the zones contained within the map.
  • Constructor Details

    • Map

      public Map()
      Create a new map without any elements.

      You should not EVER use this constructor in a non-testing environment! Because zones is final, you'll be entirely screwed over if you construct a new map like this.

    • Map

      public Map​(Zone zone)
      Create a new map with a single zone.
      Parameters:
      zone - the zone to add.
    • Map

      public Map​(Zone... zones)
      Create a new map with several zones.
      Parameters:
      zones - the zones to add to the map.
    • Map

      public Map​(me.wobblyyyy.edt.DynamicArray<Zone> zones)
      Create a new map with a list of zones.
      Parameters:
      zones - the zones to add to the map.
  • Method Details

    • isField

      private static boolean isField​(Zone zone)
      Check whether or not a given zone is technically field.
      Parameters:
      zone - the zone to check.
      Returns:
      whether or not that zone is classified as a field zone.
    • wrap

      private me.wobblyyyy.edt.DynamicArray<Zone> wrap​(me.wobblyyyy.edt.DynamicArray<Zone> zones)
      Wrap an entire field with four zones, to prevent the pathfinder from finding paths that are out-of-bounds.
      Parameters:
      zones - the original zones.
      Returns:
      a list of wrapped zones.