source: galcon-client/src/com/example/helloandroid/Planet.java@ 9b87c8d

Last change on this file since 9b87c8d was 9b87c8d, checked in by dportnoy <devnull@…>, 14 years ago

Planets get randomly generated and drawn.

  • Property mode set to 100644
File size: 659 bytes
Line 
1package com.example.helloandroid;
2
3public class Planet {
4 int radius;
5 int regenRate; // ships per second
6 private int x;
7 private 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 int getRadius() {
30 return radius;
31 }
32
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.