Last change
on this file was fb4fc67, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 6 years ago |
Initial commit, code decompiled from a jar
|
-
Property mode
set to
100644
|
File size:
669 bytes
|
Rev | Line | |
---|
[fb4fc67] | 1 | package main;
|
---|
| 2 |
|
---|
| 3 | import java.util.Iterator;
|
---|
| 4 | import java.util.LinkedList;
|
---|
| 5 |
|
---|
| 6 | public class Level {
|
---|
| 7 | public LinkedList<Ship> lstUnits;
|
---|
| 8 |
|
---|
| 9 | public Level() {
|
---|
| 10 | this.lstUnits = new LinkedList<Ship>();
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 | public Level(final Level copy) {
|
---|
| 14 | this.lstUnits = new LinkedList<Ship>();
|
---|
| 15 | final Iterator<Ship> iter = copy.lstUnits.iterator();
|
---|
| 16 | while (iter.hasNext()) {
|
---|
| 17 | this.lstUnits.add(iter.next());
|
---|
| 18 | }
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | public void addUnit(final Ship u) {
|
---|
| 22 | this.lstUnits.add(u);
|
---|
| 23 | u.loc = new Location(Math.random() * 800.0, -100.0);
|
---|
| 24 | u.targetLoc = new Location(u.loc.getX(), u.loc.getY() + 250);
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.