Class ReefscapeReefSimulation
- All Implemented Interfaces:
SimulatedArena.Simulatable
Simulates a REEFs on the field.
This class simulates a REEFs on the field where CORALs can be scored. This class
does not directly handle scoring uses an array of ReefscapeReefBranch objects. However for all other purposes
this class behaves and can be used like a normal goal.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidResets the reef to its original state.voidint[][]Obtains the amount of CORAL held on the BRANCHES.voidsimulationSubTick(int subTickNum)
-
Field Details
-
branches
-
algae
-
-
Method Details
-
draw
-
simulationSubTick
public void simulationSubTick(int subTickNum) Description copied from interface:SimulatedArena.Simulatable- Specified by:
simulationSubTickin interfaceSimulatedArena.Simulatable- Parameters:
subTickNum- the number of this sub-tick (counting from 0 in each robot period)
-
clearReef
public void clearReef()Resets the reef to its original state.
-
getBranches
public int[][] getBranches()Obtains the amount of CORAL held on the BRANCHES.This method returns a 2D array of size 12 x 4, where each entry represents the number of CORALs held on a particular branch.
The BRANCHES are tracked in FMS as A, B, C, D, E, F, G, H, I, J, K, L (as per the game manual), and are mapped to indices 0, 1, 2, ... in the array.
The [i][j] entry in the array represents the number of CORAL(s) held on the L
j-1branch in theith section.For example,
getBranches()[2][3]returns the number of CORALs held on L4 of Branch C.Note that L2, L3, and L4 can only hold one CORAL, while L1 can hold up to two CORALs.
- Returns:
- a 2D array where each entry represents the number of CORAL held on each branch
-