-
Notifications
You must be signed in to change notification settings - Fork 0
GameLogic Package
AmitSheer edited this page Dec 19, 2020
·
12 revisions
Holds classes that communicate with the server and control the game flow.
- Game
control games flow, communicates with the server and updates relevant classes with data from server - GameManager
organizes data from server - Pokemon
Holds data for location and value of pokemon to catch - PokemonTrainer
Holds data for location, current value and path to nearest pokemon - ShortestPath
Finds the shortest path to an object on the graph using the Algorithms implemented
-
Game
-
startGame(GamePanel panel,int scenario,int id)
tells the game to run with specific scenario and id -
isRunning()
checks if the process of the game is running -
gameStop()
stops the game run and the thread that runs it
-
startGame(GamePanel panel,int scenario,int id)
-
GameManager Plus implemented a getter and setter for each field.
-
updateTrainerPath(List<node_data> pathToPokemon, int trainerId)
updates the path a trainer needs to follow to catch a pokemon -
updateEdge(Pokemon fr, directed_weighted_graph g)
find and updates edge for a pokemon -
json2Pokemons(String fs, directed_weighted_graph graph)
converts JSON string of pokemons to a Pokemon Object -
getTrainers(String aa, directed_weighted_graph gg)
converts a JSON and updates the current trainers held in GameManager -
w2f(directed_weighted_graph g, Range2D frame)
converts game to size to fit new panel size
-
updateTrainerPath(List<node_data> pathToPokemon, int trainerId)
-
Pokemon_
Holds all of the data relevant to the Pokemon, location, value and current edge.
Plus implemented a getter and setter for each field. -
PokemonTrainer
Implemented a getter and setter for each field.-
update(String json)
updates all of the data of the trainer from JSON format string
-
update(String json)
-
ShortestPathAlgo
-
findShortestForAgents(GameManager _gm)
this will find the shortest path on a given graph, while taking into account distance, pokemons on the same edge, taken pokemon and scc
-
findShortestForAgents(GameManager _gm)