alexweininger/android-catan

Make Dumb AI completely random for robber move and steal

Closed this issue · 1 comments

Currently, Dumb AI cycles through a loop to choose a hex and intersection to move the robber and steal from respectively (with the correct checks of course). Need to implement this to be completely random.

Implemented random actions for entire robber phase and all subphases:

  1. Discard Phase: Dumb AI will now randomly pick a resource to discard and if they have that resource, it will be added to an array robberResourcesDiscard that holds all resources being discarded; if not, it will choose another random resource; process loops until AI has selected about half of their resources to discard

  2. Move Phase: Get the ArrayList of Hexagons; then get a random index value of this array; loop until it's a valid hexagon to move the robber to

  3. Steal Phase: Get the ArrayList of intersections around the hexagon the robber is on; then choose a random intersection to steal from; loops until they've chosen an intersection with a building that is not theirs