Last change
on this file was 7d9c033, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 6 years ago |
Initial commit, code decompiled from a jar
|
-
Property mode
set to
100644
|
File size:
704 bytes
|
Rev | Line | |
---|
[7d9c033] | 1 | import java.util.Collection;
|
---|
| 2 | import java.awt.Graphics;
|
---|
| 3 | import java.util.ArrayList;
|
---|
| 4 |
|
---|
| 5 | public class Level extends ArrayList {
|
---|
| 6 | public void draw(final Graphics g) {
|
---|
| 7 | for (int x = 0; x < this.size(); ++x) {
|
---|
| 8 | if (((Ship)this.get(x)).getHitpoints() <= 0 && ((Ship)this.get(x)).getShots().size() == 0) {
|
---|
| 9 | this.remove(this.get(x));
|
---|
| 10 | } else {
|
---|
| 11 | ((Ship)this.get(x)).draw(g);
|
---|
| 12 | }
|
---|
| 13 | }
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | public void copy(final Level permLevel) {
|
---|
| 17 | this.clear();
|
---|
| 18 | this.addAll(permLevel);
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | public void reset() {
|
---|
| 22 | for (int x = 0; x < this.size(); ++x) {
|
---|
| 23 | ((Ship)this.get(x)).reset();
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.