Last change
on this file since 9b87c8d was 9b87c8d, checked in by dportnoy <devnull@…>, 15 years ago |
Planets get randomly generated and drawn.
|
-
Property mode
set to
100644
|
File size:
659 bytes
|
Rev | Line | |
---|
[159eef8] | 1 | package com.example.helloandroid;
|
---|
| 2 |
|
---|
| 3 | public class Planet {
|
---|
| 4 | int radius;
|
---|
| 5 | int regenRate; // ships per second
|
---|
[9b87c8d] | 6 | private int x;
|
---|
| 7 | private int y;
|
---|
[159eef8] | 8 | int faction;
|
---|
| 9 | int numShips;
|
---|
| 10 |
|
---|
| 11 | public Planet(int radius, int x, int y) {
|
---|
| 12 | this.radius = radius;
|
---|
| 13 | this.x = x;
|
---|
| 14 | this.y = y;
|
---|
| 15 | faction = 0;
|
---|
| 16 | numShips = 0;
|
---|
| 17 |
|
---|
| 18 | regenRate = 0; //change this to some expression / funcion call
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | public int getX() {
|
---|
| 22 | return x;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public int getY() {
|
---|
| 26 | return y;
|
---|
| 27 | }
|
---|
| 28 |
|
---|
[9b87c8d] | 29 | public int getRadius() {
|
---|
| 30 | return radius;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
[159eef8] | 33 | public void update() {
|
---|
| 34 | //regen ships if not owned by faction 0
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | public void sendFleet(Planet p, int numShips) {
|
---|
| 38 |
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.