Last change
on this file since 76819ac was 159eef8, checked in by dportnoy <devnull@…>, 15 years ago |
Created basic interfaces for Fleet and Planet.
|
-
Property mode
set to
100644
|
File size:
591 bytes
|
Rev | Line | |
---|
[159eef8] | 1 | package com.example.helloandroid;
|
---|
| 2 |
|
---|
| 3 | public class Planet {
|
---|
| 4 | int radius;
|
---|
| 5 | int regenRate; // ships per second
|
---|
| 6 | int x;
|
---|
| 7 | int y;
|
---|
| 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 |
|
---|
| 29 | public void update() {
|
---|
| 30 | //regen ships if not owned by faction 0
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | public void sendFleet(Planet p, int numShips) {
|
---|
| 34 |
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.