Skip to content

Commit

Permalink
pIndex确属没用。删了。
Browse files Browse the repository at this point in the history
  • Loading branch information
GinRyan committed Feb 6, 2020
1 parent bb7b33f commit 8cecf60
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/MyPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
public class MyPanel extends JPanel implements Runnable {

private int pIndex = 0;//人口池PersonPool的下标,用于遍历每个人


public MyPanel() {
Expand All @@ -37,7 +36,6 @@ public void paint(Graphics g) {
if (people == null) {
return;
}
people.get(pIndex).update();
for (Person person : people) {
switch (person.getState()) {
case Person.State.NORMAL: {
Expand Down Expand Up @@ -69,10 +67,7 @@ public void paint(Graphics g) {
g.fillOval(person.getX(), person.getY(), 3, 3);

}
pIndex++;
if (pIndex >= people.size()) {
pIndex = 0;
}

int captionStartOffsetX = 700 + Hospital.getInstance().getWidth() + 40;
int captionStartOffsetY = 40;
int captionSize = 24;
Expand Down

0 comments on commit 8cecf60

Please sign in to comment.