Gifts - dean985/taxiDriver GitHub Wiki

Gifts

Gifts are represented in the code through Fruits.

Gift (Fruit)

Fruit(JSONObject json_fruit) - initializing the fruit from a JSONObject

replaceFruit(graph graph) - When a gift is collected by a car, then it's immediately replaced with a new gift on a different edge on the graph (randomly) with a new value.


Gifts (gameFruits)

gameFruits(game_service game, graph graph) - Initialize the gifts for the game.

edgeOfFruit(int fruit_id) - This method return the edge a certain gift is on currently.

maxFruit() - return the gift with maximum value that there is on the graph.