Skip to content

Commit

Permalink
[Spatial Partition] (Change) Hashtable to Map, (Remove) unused variab…
Browse files Browse the repository at this point in the history
…le BUBBLE
  • Loading branch information
tiennm99 committed Jun 28, 2023
1 parent 0025ac7 commit f9e5dfe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

@Slf4j
public class App {
private static final String BUBBLE = "Bubble ";

static void noSpatialPartition(int numOfMovements, Map<Integer, Bubble> bubbles) {
//all bubbles have to be checked for collision for all bubbles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
package com.iluwatar.spatialpartition;

import java.util.Collection;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.Map;

/**
* The quadtree data structure is being used to keep track of the objects' locations. It has the
Expand All @@ -37,7 +38,7 @@ public class QuadTree {
Rect boundary;
int capacity;
boolean divided;
Hashtable<Integer, Point> points;
Map<Integer, Point> points;
QuadTree northwest;
QuadTree northeast;
QuadTree southwest;
Expand All @@ -47,7 +48,7 @@ public class QuadTree {
this.boundary = boundary;
this.capacity = capacity;
this.divided = false;
this.points = new Hashtable<>();
this.points = new HashMap<>();
this.northwest = null;
this.northeast = null;
this.southwest = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package com.iluwatar.spatialpartition;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
package com.iluwatar.spatialpartition;

import java.util.Hashtable;
import java.util.Map;

/**
* This abstract class has 2 fields, one of which is a hashtable containing all objects that
Expand All @@ -35,7 +35,7 @@

public abstract class SpatialPartitionGeneric<T> {

Hashtable<Integer, T> playerPositions;
Map<Integer, T> playerPositions;
QuadTree quadTree;

/**
Expand Down

0 comments on commit f9e5dfe

Please sign in to comment.