API Docs for:
Show:

models.CatanHex Class

Extends hexgrid.BasicHex
Module: catan.models

This class represents a Hex. You may add any methods that you need (e.g., to get the resource/hex type, etc.)

In order to work with the hexgrid, this class must extend hexgrid.BasicHex (already done in the code). You also need to implement
a CatanVertex and CatanEdge classes (stubs are provided in this file).  Look at their documentation to see what needs to be done there.

The hexgrid will be passed an instance of this class to use as a model, and will pull the constructor from that instance. 
(The core.forceInherit sets the constructor, in case you are curious how that works)

Constructor

models.CatanHex

(
  • location
)

Parameters:

  • location hexgrid.HexLocation
    • the location of this hex. It's used to generate locations for the vertexes and edges.

Item Index